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

How many students are affected by each allergy type?
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"