练习题
1. 列出所有员工的姓名、部门名称和工资
Select e.ename,d.dname,e.sal
From emp e,dept d
Where e.deptno=d.deptno;
2. 列出所有部门的详细信息和部门人数
Select d.deptno,d.dname, d.loc,count(e.empno)
From emp e,dept d
Where e. deptno(+)=d.deptno
Group by d.deptno,d.dname,d.loc;
3. 列出所有员工的年工资、所在部门名称,按年薪升序排序
Select e.ename,e.sal*12 income,d.dname
From emp e,dept d
Where e.deptno=d.deptno
Order by income;
1