Who are all the male students?
select * from student where sex = 'M'
Of these, who have allergies to food type?
select * 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")
How many are there?
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")