How many different departments are there in each school that has less than 5 apartments?
SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
[{'count(DISTINCT dept_name)': 4, 'SCHOOL_CODE': 'BUS'}]