CREATE TABLE Allergy_type (allergy VARCHAR2, allergytype VARCHAR2)
CREATE TABLE Has_allergy (allergy VARCHAR2)

How many students have a food allergy?
SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"
SELECT COUNT(*) FROM "Has_allergy" "T1" JOIN "Allergy_type" "T2" ON "T1"."allergy" = "T2"."allergy" AND "T2"."allergytype" = "food"