方法)外部表联结
要求包含未分配部门的员工(即所有员工),因此外部联结全部员工信息表
SELECT e.last_name, e.first_name, de.dept_no FROM dept_emp AS de RIGHT JOIN employees AS e -- 右外部表联结 ON de.emp_no = e.emp_no;
SELECT e.last_name, e.first_name, de.dept_no FROM dept_emp AS de RIGHT JOIN employees AS e -- 右外部表联结 ON de.emp_no = e.emp_no;