Could you please find the number of male (sex is 'M') students who have some type of food allergy?
select count ( * ) from student where sex = "M" and stuid in ( select stuid from has_allergy as t1 join allergy_type as t2 on t1.allergy = t2.allergy where t2.allergytype = "food" )
What are their full names and the names of the food allergies they have?
select t3.fname, t3.lname,t2.allergy from has_allergy as t1 join allergy_type as t2 on t1.allergy = t2.allergy join student as t3 on t3.stuid = t1.stuid where t2.allergytype = "food" and t3.sex = 'M'
How many female students are allergic to cats?
select count ( * ) from has_allergy as t1 join student as t2 on t2.stuid = t1.stuid where t1.allergy = "Cat" and t2.sex = 'F'