What are the names of the dogs for which the owner has not spend more than 1000 for treatment ?
select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment)  >  1000 )
select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment)  >  1000 )
[{'name': 'Kacey'}, {'name': 'Hipolito'}, {'name': 'Mavis'}, {'name': 'Houston'}, {'name': 'Jeffrey'}, {'name': 'Merritt'}, {'name': 'Narciso'}, {'name': 'George'}, {'name': 'Bessie'}, {'name': 'Betty'}, {'name': 'Holden'}, {'name': 'Jesus'}]