SELECT e.employee_id,e.last_name,d.department_name,l.city
from employees e,departments d,locations l
where e.manager_id = d.manager_id and
d.location_id = l.location_id;
SELECT * from job_grades;
#对应的名字,月薪,等级
SELECT e.last_name,e.salary,j.grade_level
from employees e,job_grades j
WHERE e.salary BETWEEN j.lowest_sal and j.highest_sal;
SELECT e.last_name,e.salary,j.grade_level
from employees e,job_grades j
WHERE e.salary >= j.lowest_sal AND
e.salary<=j.highest_sal;
#自我引用(自恋)
SELECT * from employees;
#联系 员工ID,姓名,及管理者ID和姓名
SELECT emp.employee_id,emp.last_name,mgr.employee_id,mgr.last_name
from employees emp,employees mgr
WHERE emp.manager_id = mgr.employee_id;