当前位置:Gxlcms > 数据库问题 > sql 查询语句的练习

sql 查询语句的练习

时间:2021-07-01 10:21:17 帮助过:13人阅读

--1、使用基本查询语句.
--(1)查询DEPT表显示所有部门名称.
select * from dept;
--(2)查询EMP表显示所有雇员名及其全年收入(月收入=工资+补助),处理NULL行,并指定列别名为"年收入"。(NVL(comm,0) comm取空值时用0替代)
select ename,12*(sal+nvl(comm,0)) "年收入" from emp;
--(3)查询显示不存在雇员的所有部门号。
select d.deptno from dept d where d.deptno not in (select distinct deptno from emp)

sql 查询语句的练习

标签:存在   查询   --   name   sel   null   nvl   not   from   

人气教程排行