select dep.dept_no dept_no, dep.dept_name dept_name, s1.title title, count(s1.title) cout from departments dep join (select de.dept_no dept_no,ti.title title from dept_emp de join titles ti on de.emp_no = ti.emp_no where de.to_date = '9999-01-01' and ti.to_date = '9999-...