Task: Text to Code
Input (English): What is the average age of the dogs who have gone through any treatments?
Output (English): SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )