步骤分解
1.将salaries和dept_manager两个表,以dept_manager为主表,进行连接,并查找薪水详情(salaries表中所有字段)以及dept_manager表中的dept_no
select s.*, d.dept_no from dept_manager d left join salaries s on d.emp_no = s.emp_no
或者
select s.*, d.dept_no from salaries s right join dept_manager d on d.emp_no = s.emp_no
2.将1的查询结果,按照salaries.emp_no升序排序
order by s.emp_no
完整答案
select s.*, d.dept_no from dept_manager d left join salaries s on d.emp_no = s.emp_no order by s.emp_no;