Which students are over 18?
select * from student where age > 18
Of them, who are not allergic to food or animal?
select * from student where age > 18 and stuid not in ( select stuid from has_allergy as t1 join allergy_type as t2 on t1.allergy = t2.allergy where t2.allergytype = "food" or t2.allergytype = "animal")
How many?
select count(*) from student where age > 18 and stuid not in ( select stuid from has_allergy as t1 join allergy_type as t2 on t1.allergy = t2.allergy where t2.allergytype = "food" or t2.allergytype = "animal")