select a.last_name, a.department_id, b.department_name from employees as a,departments as b where a.department_id=b.department_id
SELECT e.job_id,d.location_id from employees as e join departments as d on d.department_id=e.department_id WHERE d.department_id=90
select employees.last_name, departments.department_name, locations.location_id, locations.city from employees left join departments on departments.department_id=employees.department_id left join locations on departments.location_id=locations.location_id where commission_pct is not null
select last_name, job_id, employees.department_id , department_name from employees left join departments on employees.department_id=departments.department_id left join locations on departments.location_id=locations.location_id where locations.city='Toronto'
select department_name,city,last_name, job_title, salary from departments left join employees on employees.department_id=departments.department_id left join locations on departments.location_id=locations.location_id left join jobs on employees.job_id=jobs.job_id where department_name="Executive"
select e.last_name
employees, e.employee_id
Emp#,m.last_name
manager, m.employee_id
Mgr#from employees e left join employees m on e.manager_id = m.employee_id
select department_name from departments left join employees on departments.department_id=employees.department_id where employees.department_id is null
SELECT city from locations left join departments on locations.location_id = departments.location_id where departments.location_id is null
select employees.* from employees left join departments on employees.department_id = departments.department_id where department_name = "Sales" or department_name = "IT"
让时间为你证明