How many departments are in each school?
SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code
count of departments in each school refers to COUNT(DISTINCT dept_name); grouped by each school refers to GROUP BY school_code;