text: Below is an context that describes a sql query, paired with an question that provides further information. Write an answer that appropriately completes the request.  # noqa: E501
  ### Context:
  CREATE TABLE dogs (name VARCHAR, dog_id VARCHAR, cost_of_treatment INTEGER); CREATE TABLE treatments (name VARCHAR, dog_id VARCHAR, cost_of_treatment INTEGER)
  ### Question:
  Which dogs have not cost their owner more than 1000 for treatment ? List the dog names .
  ### Answer:
  SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000)