zoukankan      html  css  js  c++  java
  • 6.3 练习题

    二、练习

    1. 查询出部门编号为30的所有员工

     Select * from ygb where deptno=30;


    2. 所有销售员的姓名、编号和部门编号。

    Select ename ,mgr ,deptno from ygb;


    3. 找出奖金高于工资的员工。

     Select * from ygb where comm>sal;


    4. 找出奖金高于工资60%的员工。

    Select * from ygb where comm>0.6*sal;


    5. 找出部门编号为10中所有经理,和部门编号为20中所有销售员的详细资料。

    Select * from ygb where (deptno=10 and job='经理')or(deptno=20 and job ='销售员');

    6. 找出部门编号为10中所有经理,部门编号为20中所有销售员,还有即不是经理又不是销售员但其工资大或等于20000的所有员工详细资料。

      Select * from ygb where (deptno=10 and job='经理')or(deptno=20 and job ='销售员')or(job not in('经理','销售员')and sal >=20000);

    7. 无奖金或奖金低于1000的员工。

    select * from ygb where comm<1000;


    8. 查询名字由三个字组成的员工。

    select * from ygb where ename like'___';
    9.查询2000年入职的员工。

    select * from ygb where hiredate between '2000-01-01' and '2000-12-31';

    select * from ygb where hiredate >= "2000-01-01" and hiredate <= "2000-12-31";


    10. 查询所有员工详细信息,用编号升序排序

    select * from ygb order by empno asc;


    11. 查询所有员工详细信息,用工资降序排序,如果工资相同使用入职日期升序排序

    select * from ygb order by sal desc , hiredate asc;

    12. 查询姓周的两个名字的员工。

    select * from ygb where ename like "_";

    13. 查询所有姓张的员工。

    select * from ygb where ename like "%";

  • 相关阅读:
    winfrom让窗体在屏幕右下角慢慢向上弹出
    winfrom的StatusStrip控件如何设置控件右对齐
    Winfrom通过Panel拖动无边框窗体
    优秀学习资源汇总
    hexo+github搭建博客跳坑
    博客园主题样式修改
    wxss无法调用本地资源图片
    微信小程序wx:for循环
    Git常用命令总结
    git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)
  • 原文地址:https://www.cnblogs.com/sunhao1987/p/9130068.html
Copyright © 2011-2022 走看看