查询出每个员工的姓名、职位、月薪、所属部门名、月薪等级及其领导的姓名、职位、所属部门名、月薪等级。
select e.ename 员工姓名,e.job 员工职位,e.sal 员工月薪,d.dname 员工所属部门名,s.grade 员工月薪等级,m.ename 领导姓名,m.job 领导职位,md.dname 领导所属部门名,ms.grade 领导月薪等级
from emp e
left join dept d on e.deptno = d.deptno
left join salgrade s on e.sal between s.losal and s.hisal
left join emp m on e.mgr = m.empno
left join dept md on m.deptno = md.deptno
left join salgrade ms on m.sal between ms.losal and ms.hisal;