CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
CREATE TABLE allergy_type (allergy CLOB, allergytype CLOB)
CREATE TABLE has_allergy (stuid NUMBER, allergy CLOB)

Show all allergy type with number of students affected.
SELECT T2.allergytype, COUNT(*) FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype
SELECT "T2"."allergytype", COUNT(*) FROM "has_allergy" "T1" JOIN "allergy_type" "T2" ON "T1"."allergy" = "T2"."allergy" GROUP BY "T2"."allergytype"