题解 | #统计各个部门的工资记录数#
统计各个部门的工资记录数
http://www.nowcoder.com/practice/6a62b6c0a7324350a6d9959fa7c21db3
SELECT d.dept_no ,d.dept_name, count(s.salary) AS sum
FROM salaries s
JOIN dept_emp de
USING (emp_no)
JOIN departments d
USING (dept_no)
GROUP BY d.dept_no
ORDER BY d.dept_no