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
What is the type of allergy Cat?
assistant
SELECT allergytype FROM Allergy_type WHERE allergy = 'Cat'
human
How many allergies are there?
assistant
SELECT count(DISTINCT allergy) FROM Allergy_type
human
Which allergy type has least number of allergies?
assistant
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1
human
Which allergy type has most number of allergies?
assistant
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1
human
How many different allergy types exist?
assistant
SELECT count(DISTINCT allergytype) FROM Allergy_type
human
How many animal type allergies exist?
assistant
SELECT COUNT( * ) FROM Allergy_type WHERE allergytype = "animal" ;