oracle经典20道笔试题
[10-16 20:00:41] 来源:http://www.89xue.com 笔试 阅读:90次
摘要:select job,min(sal) from emp group by job17.列出各个部门的MANAGER(经理)的最低薪金。select deptno,min(sal) from emp where job=’MANAGER’ group by deptno18.列出所有员工的年工资,按年薪从低到高排序。select empno,ename,sal*12 as 年薪 from emporder by sal19. 求各种工作工资最低的员工。方法一:select * from emp awhere sal=(select min(sal) from emp b where b.j。
oracle经典20道笔试题,标签:笔试范文,http://www.89xue.com
select job,min(sal) from emp group by job
17.列出各个部门的MANAGER(经理)的最低薪金。
select deptno,min(sal) from emp where job=’MANAGER’ group by deptno
18.列出所有员工的年工资,按年薪从低到高排序。
select empno,ename,sal*12 as 年薪 from emp
order by sal
19. 求各种工作工资最低的员工。
方法一:
select * from emp a
where sal=(select min(sal) from emp b where b.job=a.job)
方法二:
select emp.*
from emp a,( select job,min(sal) min_sal from emp group by job) b
where a.job=b.job and a.sal=b.min_sal
20. 列出各种工作工资前3名的员工
select * from (
select empno,ename,sal,job,
dense_rank() over(partition by job order by sal desc) as 名次
from emp ) a
where a.名次<=2
order by job;
说明:用到了Oracle强大的“分区排名技术”,其中“dense_rank()”是Oracle的解析函数。
Tag:笔试,笔试范文,招聘应聘 - 笔试
上一篇:麦当劳笔试真题笔试智力题