select employee_id,last_name,department_name,city
from employees e,departments d,locations l
where e.department_id=d.department_id
and d.location_id=l.location_id;
-- 多表查询分类{归纳式}
-- 1、等值链接 vs 非等值连接
-- 2、自连接{自我引用} vs 非自我连接
-- 3、内连接 vs 外连接
-- 1
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;
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;