27、显示各种职位的最低工资(组函数)
select MIN(SALARY) from employees GROUP BY DEPARTMENT_ID
28、求1997年各个月入职的的员工个数(考察知识点:组函数)
select count(*) from employees GROUP BY HIRE_DATE between '1997-01-01' and '1997-12-31'
29、查询每个部门的最高工资(考察知识点:分组)
select MAX(SALARY) from employees GROUP BY DEPARTMENT_ID
30、查询每个部门,每种职位的最高工资(考察知识点:分组)
select MAX(jobs.MAX_SALARY) from employees RIGHT JOIN jobs ON employees.JOB_ID=jobs.JOB_ID GROUP BY DEPARTMENT_ID
31、查询各部门的总工资
select SUM(SALARY) from employees GROUP BY DEPARTMENT_ID
版权声明:本文为qq_68334807原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。