1.查询所有员工薪资,排序?
select salary? ename from? emp order by
salary? DESC
2.按照薪资降序,取出排名在前5名的员工?
select SAL? ENAME from? EMP order by
SAL DESC limit 5
3.取出工资排名在[3-5]名的员工?
select SAL,ENAME from? EMP order by
SAL DESC limit 2,3
4.找出最高工资?
select max(salary) from? emp order by
salary? DESC
5.找出最低工资?
select min(salary) from? emp order by
salary? DESC
6.计算工资和?
select sum(salary) from? emp
7.计算平均工资?
select avg(salary) from? emp
8.计算员工数量?
select count(*) from? EMP
9.找出每个工作岗位的工资和?
select JOB,SUM(SAL) from? emp group by JOB
10.找出每个部门的最高薪资?
select DEPTNO,SUM(SAL) from? emp group by? DEPTNO
11.找出“每个部门,不同工作岗位”的最高薪资?
12.找出每个部门平均薪资,要求显示平均薪资高于2500的?
13.找出每个岗位的平均薪资,要求显示平均薪资大于1500的,除MANAGER岗位之外,
???? 要求按照平均薪资降序排?
select? job, avg(sal) as avgsal? from? emp? where? job <> 'MANAGER'? group by? job? having? avg(sal) > 1500? order by? avgsal desc;
14.查询每个员工所在部门名称,显示员工名和部门名?
15.找出每个员工的薪资等级,要求显示员工名、薪资、薪资等级?
16.查询员工的上级领导,要求显示员工名和对应的领导名?
17.找出比最低工资高的员工姓名和工资?
18.找出每个岗位的平均工资的薪资等级?