sql查询问题请高手指教
1,我只能查询出来部门和薪水最高的查不来人,2,只能查出来部门和评价薪水,查不出等级
empno ename job mgr hiredate sal comm. deptno
7369 smith clerk 7902 1980-12-17 800 20
7499 allen salsman 7698 1981-2-20 1600 300 30
7521 ward salesman 7698 1981-2-22 1250 500 30
7566 jones manager 7839 1981-4-2 2795 20
7654 martin salesman 7698 1981-9-28 1250 1400 30
7698 blake manager 7839 1981-5-1 2850 30
7782 clark manager 7839 1981-6-9 2450 10
7788 scott analyst 7566 1987-4-19 3000 20
7839 king president 1981-11-17 5000 10
7844 turner salesman 7698 1981-9-8 1500 30
7876 adams clerk 7788 1987-5-23 1100 20
7900 janes clerk 7698 1981-12-3 950 30
7902 ford analyst 7566 1981-12-3 3000 20
7934 miller clerk 7782 1982-1-23 1300 10
emp(职员表)
(职员编号,职员名,工作类型,经理人编号,入职日期,薪水,津贴,所在部门编号)
dept(部门表)
deptno(部门编号) dname(部门名称) loc(部门所在地)
10 accouting newyork
20 research dallas
30 sales Chicago
40 operations boston
salgrade(薪水等级表)
grade(薪水等级) losal(最低薪水) hisal(最高薪水)
1 700 1200
2 1201 1400
3 1401 2000
4 2001 3000
5 3001 9999
求部门中哪些人的薪水最高
求部门平均薪水的等级