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