Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:

Convert text to sql: How old are the students with allergies to food and animal types on average? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select avg ( _ ) from _ where _ in ( select _ from _ where _ intersect select _ from _ where _ ) | select avg ( age ) from student where stuid in ( select has_allergy.stuid from has_allergy join allergy_type on has_allergy.allergy = allergy_type.allergy where allergy_type.allergytype = 'food' intersect select has_allergy.stuid from has_allergy join allergy_type on has_allergy.allergy = allergy_type.allergy where allergy_type.allergytype = 'animal' )