human
Schema:
Allergy_Type (Allergy, AllergyType)
Has_Allergy (StuID, Allergy)
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Please answer with SQL.
assistant
Sure, I understand.
human
Most number of students affected by which allergy?
assistant
SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY COUNT( * ) DESC LIMIT 1;
human
Which allergy affects student ID 1001
assistant
SELECT Allergy FROM Has_allergy WHERE StuID = 1001;
human
Which allergy affects student ID 1002
assistant
SELECT Allergy FROM Has_allergy WHERE StuID = 1002 ;