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;
SELECT employee_id,last_name,department_name,city
FROM employees,departments,locations
WHERE employees.department_id=departments.department_id
AND departments.location_id=locations.location_id;
SELECT e.employee_id,e.last_name,d.department_name,l.city
FROM employees e, departments d, locations l
WHERE e.department_id=d.department_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 * FROM employees;
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;