SELECT d.dept_no,d.dept_name,COUNT(*) sum
FROM
dept_emp de LEFT JOIN departments d ON de.dept_no=d.dept_no
INNER JOIN salaries s ON de.emp_no=s.emp_no
GROUP BY d.dept_no
ORDER BY d.dept_no;