select a.dept_no,b.dept_name,c.title,count(1) count
from dept_emp a 
left join departments b 
on a.dept_no = b.dept_no
left join titles c 
on c.emp_no =a.emp_no
group by a.dept_no,c.title
order by  a.dept_no,c.title

按照要求把表连接好,再按要求分组聚合即可