Task: Text to Code
Input (English): Which dogs have not cost their owner more than 1000 for treatment? List the dog names.
Output (English): SELECT name FROM Dogs WHERE dog_id NOT IN( SELECT dog_id FROM Treatments GROUP BY dog_id HAVING sum(cost_of_treatment)  >  1000 )