oracle数据库习题1

xiaoxiao2021-02-28  64

1.选择部门中30的雇员 select * from emp where deptno=30; 2.找出佣金高于薪金的雇员 select * from emp where comm>sal; 3.找出佣金高于薪金60%的雇员 select * from emp where comm>(sal*0.6); 4.找出收取佣金的雇员的不同工作 select distinct job as "工作" from emp where comm is not null; 5.找出不收取佣金或者是佣金低于100的雇员 select ename as "姓名" from emp where comm is null or comm <100; 6.显示不带有R的雇员的姓名 select ename as "姓名" from emp where not ename like '%R%'; 7.查询工资在1500-3000之间的全部雇员信息 select * from emp where sal between 1500 and 3000; 8.显示每个雇员的年工资 select ename as "姓名",sal*12 as "年工资" from emp; 9.检索emp表中有提成的员工的信息 select * from emp where comm is not null;10.检索月收入在800或1750的员工信息 --查询1982年1月1人后入职的员工 select * from emp where hiredate>'01-1月 -82'; --首字母为大写S的员工 select * from emp where ename like 'S%'; --第三个字符为O的人 select * from emp where ename like '__O%'; --查询员工号为 123、456,789; select * from emp where empno in(123,456,789); --如何显示没有上级的人(就是直列段为空) select * from emp where mgr is null; --工作该高于五百,岗位为manager,同时首之母为大写的J select * from emp where sal>500 and job='MANAGER' and ename like 'J%'; -- 按照部门号升序 ,员工工资降序 select * from emp order by deptno asc,sal desc; --使用列的别名排序 select empno as "职工号" from emp order by '职工号';
转载请注明原文地址: https://www.6miu.com/read-55725.html

最新回复(0)