Task: Text to Code
Input (English): SQL: SELECT Avg ( age ) FROM Dogs WHERE gender = 1
Feedback: Ensure that dog id should be detect in treatment table.
Output (English): SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )