Java数据库sql语句

根据Scott用户下的表(emp员工表,dept部门表)完成以下sql语句
1.每个部门的部门名称和本部门的员工工资总额、平均工资和最大工资
2.利用员工编号升序排序后,检索第5-10条记录


1、select dept.部门名称,sum(emp.工资),avg(emp.工资),max(emp.工资) from emp,dept where dept.部门id=emp.部门id  group by  dept.部门id
2select * from emp  order 编号 asc limit 5,5

1.
select t1. dname, sum(t.sal), avg(t.sal),max(t.sal)
from emp t
join dept t1 on t.dno=t1.dno
group by t1.dname;

  1. select t1.*
    from
    (select t.*, rownum rn
    from emp t order by t.empno) t1
    where t1.rn between 5 and 10;