CREATE TABLE dogs (name VARCHAR(255), dog_id VARCHAR(255), cost_of_treatment INTEGER); CREATE TABLE treatments (name VARCHAR(255), dog_id VARCHAR(255), cost_of_treatment INTEGER)
Which dogs have not cost their owner more than 1000 for treatment ? List the dog names .
    
SQL: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000)