Construct an SQL query to find the names of each department with more than 5 professors
Let's do this a little more visually:
SELECT dept.name as department_name, COUNT(prof.id) as professor_count
  FROM Department dept INNER JOIN Professor prof ON prof.deptID = dept.deptID
 GROUP BY dept.name
 ORDER BY professor_count DESC;

This will give you all departments plus the count of professors sorted by (arguably) the most expensive departments. Seeing the data in front of you will allow you to verify its correctness before continuing.
Now, if you want to show just the departments with more than five professors, you can add HAVING professor_count &gt; 5 between GROUP BY and ORDER BY.