Question: Show all allergy type with number of students affected.
Schema: create table has_allergy (allergy varchar, PRIMARY KEY (allergy)); create table allergy_type (allergytype varchar, allergy varchar, PRIMARY KEY (allergytype))
SQL: select t2.allergytype, count(*) from has_allergy as t1 join allergy_type as t2 on t1.allergy = t2.allergy group by t2.allergytype