SELECT EM_Dep,COUNT(EM_ID) FROM department GROUP BY EM_Dep
Code (SQL)
SELECT EM_Dep,b.SexMan,b.SexWomen
FROM department a
INNER JOIN
( SELECT EM_Dep,COUNT(Sex_ID) As SexMan FROM department WHERE Sex_ID = '1' GROUP BY EM_Dep) b
ON a.EM_Dep = b.EM_Dep
INNER JOIN
( SELECT EM_Dep,COUNT(Sex_ID) As SexWomen FROM department WHERE Sex_ID = '2' GROUP BY EM_Dep) c
ON a.EM_Dep = c.EM_Dep
GROUP BY a.EM_Dep