select de.dept_no,dept_name,title,count(title) -- 呈现的字段
from dept_emp as de,departments as dp,titles as ti -- 需要连接的表
where 
de.dept_no=dp.dept_no 
and de.emp_no=ti.emp_no 
and de.to_date='9999-01-01'-- 连接条件(注意是否在职)
group by de.dept_no,title
order by de.dept_no,title