select dm.*,t.title,count(t.title) count
from departments dm
join dept_emp de
on dm.dept_no = de.dept_no
join titles t 
on de.emp_no = t.emp_no
group by dm.dept_no,t.title
order by dm.dept_no asc;