select d.dept_no, d.dept_name, count(s.salary) sum 
from salaries s left join dept_emp de 
on s.emp_no = de.emp_no 
left join departments d
on d.dept_no = de.dept_no 
group by d.dept_name 
order by d.dept_no