Please, read my comment to the question first...
If you would like to know how many people with specific gender is employed in departments, use this:
select DE.nombre as departamento, H.sex, count(H.sex) as nroHijos_Varones
from hijos H
inner join empleado E on H.id_padre = E.id
inner join dept DE on E.dept = DE.cod
where H.sex = 'M'
group by DE.nombre, H.sex;