SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
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 ) < value
How many different departments are there in each school that has less than 5 apartments ?