- 20
- 0
- 约2.06万字
- 约 15页
- 2016-12-02 发布于河南
- 举报
oracle数据库面试程序员
01. 查询员工表所有数据, 并说明使用*的缺点
答:
select * from emp;
使用*的缺点有
a) 查询出了不必要的列
b) 效率上不如直接指定列名
02. 查询职位(JOB)为PRESIDENT的员工的工资
答:
select * from emp where job = PRESIDENT;
03. 查询佣金(COMM)为0 或为NULL 的员工信息
答:重点是理解0 与null 的区别
select * from emp where comm = 0 or comm is null;
04. 查询入职日期在1981-5-1 到1981-12-31 之间的所有员工信息
答:通过此题掌握常用日期函数
select * from emp where hiredate
between to_date(1981-5-1,yyyy-mm-dd) and to_date(1981-12-31,yyyy-mm-dd);
05. 查询所有名字长度为4 的员工的员工编号,姓名
答:
select * from emp where length(ename) = 4;
06. 显示10 号部门的所有经理(MANAGER)和20 号部门的所有职员(CLERK)的详细信息
答:
select * from emp where deptno
原创力文档

文档评论(0)