How many heads does each department have?
select t1.name, count(*) from management as t2 join department as t1 on t1.department_id = t2.department_id group by t1.department_id
Which department has more than 1 head at a time?
select t1.department_id, t1.name from management as t2 join department as t1 on t1.department_id = t2.department_id group by t1.department_id having count(*) > 1
List the id, name and the number of heads of these departments.
select t1.department_id, t1.name, count(*) from management as t2 join department as t1 on t1.department_id = t2.department_id group by t1.department_id having count(*) > 1