zoukankan      html  css  js  c++  java
  • oracle基于scott用户的经典sql 面试题(一)

    1、列出在部门'SALES'(销售部)工作的员工的所有信息,和相关的部门信息,使用左连接的方式连表。

    select * from emp e  left outer join dept t on( e.deptno=t.deptno) where e.deptno in(select deptno from dept d where dname='SALES');

    2、列出薪金高于公司平均薪金的所有员工。
    SQL> select empno,ename,sal,avg(sal) avgsal from emp where sal>(select avg(sal) from emp ) group by empno,ename,sal ;

     3、列出与“SCOTT”从事相同工作的所有员工。
    select empno,ename,job from emp where job=(select job from emp where ename='SCOTT') and ename<>'SCOTT';

     4、列出所有员工的年工资,按年薪从低到高排序。
    select ename,(sal+nvl(comm,0))*12 total from emp order by total asc;

  • 相关阅读:
    auto-sklearn案例解析二
    auto-sklearn案例解析二
    auto-sklearn案例解析一
    auto-sklearn案例解析一
    auto-sklearn简介
    auto-sklearn简介
    auto-sklearn手册
    auto-sklearn手册
    观念
    JDBC总结
  • 原文地址:https://www.cnblogs.com/fengshuzi/p/2987618.html
Copyright © 2011-2022 走看看