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
Who have allergy to soy?
assistant
SELECT * FROM Has_allergy WHERE Allergy = 'Soy';
human
Who have not?
assistant
SELECT * FROM Student WHERE StuID NOT IN ( SELECT StuID FROM Has_allergy WHERE Allergy = "Soy" ) ;