法一:三表连续内连接。
注意:连续内连接中一定不要出现WHERE(21题的经验)
select d.dept_no,d.dept_name,count(*) as sum from salaries s inner join dept_emp de on s.emp_no=de.emp_no inner join departments d on d.dept_no=de.dept_no group by d.dept_no
法二:三表联结,WHERE筛选
select d.dept_no,d.dept_name,count(*) as sum from salaries s,dept_emp de,departments d where s.emp_no=de.emp_no and d.dept_no=de.dept_no group by d.dept_no