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
Can you give me the allergies that the student with the first name Lisa has
assistant
SELECT T1.Allergy FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = 'Lisa';
human
Are there any other names that have allergies | Do you want the first name or the last name of students other than Lisa who have allergies? | Can i have the list of foods that Lisa is allergic to
assistant
SELECT T1.Allergy FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" AND T1.AllergyType = "food" ;