Oracle-03
来源:互联网 发布:数据库百科 编辑:程序博客网 时间:2024/06/09 18:53
1./*求出某个员工的上级,并要求这些主管的薪水高于3000*/
这个需要左外连接 oracle中的外连接简写就是(+)
SQL> select distinct m.ename from emp e,emp m where e.mgr=m.empno(+) and m.sal>3000;
不用简写的写法:select distinct m.ename from emp e left join emp m on e.mgr=m.empno and m.sal>3000;
2./*求部门名称带字符‘S’的部门,员工,工资合计,部门人数*/
SQL> select d.dname,e.ename,m.sum,m.count from emp e,dept d,(select deptno,sum(sal) sum,count(*) count from emp group by deptno) m where e.deptno=m.deptno and d.deptno=m.deptno and d.dname like '%S%';
这个比较多一点
3.给任职日期超过十年的人加薪10%
update emp set sal=sal*1.1 where months_between(sysdate,hiredate)>120;
4./*.按照员工的部门号升序排列,同部门的再按员工工资降序排列;*/
SQL> select * from emp order by deptno,sal desc;
5./*查出哪个部门的工资是最低的。*/
- Oracle-03
- Oracle复习笔记03
- ORACLE入门03
- oracle入门03
- Oracle Procedure示例03
- ORACLE数据库学习03
- oracle 03-13
- oracle数据库03
- ORACLE数据库总结03
- oracle笔记03
- 03oracle学习笔记
- Oracle???
- oracle
- oracle
- oracle
- oracle
- oracle...
- oracle
- HDU 3706——Second My Problem First
- 使用事务与锁,实现一个用户取过的数据不被其他用户取到
- 开机引导项多了onekey ghost,怎么删除?
- Discuz X2.5搬家记录
- Using Web Server Plug-Ins with WebLogic Server
- Oracle-03
- 谷歌三大核心技术(二)Google MapReduce中文版
- 一个高级的Android启动画面
- mkv中cluster位置的计算
- matlab—size用法
- JNI引用与垃圾回收
- Memcached之内存利用率提升经验分享
- 快速排序、堆排序、希尔排序实现
- 【心灵鸡汤】@2012-06-15