output
stringlengths
18
577
instruction
stringlengths
16
224
input
stringclasses
160 values
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id
Show name of all students who have some friends and also are liked by someone else.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id
What are the names of high schoolers who both have friends and are liked?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT student_id , count(*) FROM Likes GROUP BY student_id
Count the number of likes for each student id.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT student_id , count(*) FROM Likes GROUP BY student_id
How many likes correspond to each student id?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name , count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
Show the names of high schoolers who have likes, and numbers of likes for each.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name , count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
What are the names of high schoolers who have likes, and how many likes does each have?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
What is the name of the high schooler who has the greatest number of likes?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
Give the name of the student with the most likes.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 2
Show the names of students who have at least 2 likes.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 2
What are the names of students who have 2 or more likes?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING count(*) >= 2
Show the names of students who have a grade higher than 5 and have at least 2 friends.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING count(*) >= 2
What are the names of high schoolers who have a grade of over 5 and have 2 or more friends?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle"
How many likes does Kyle have?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle"
Return the number of likes that the high schooler named Kyle has.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id)
Find the average grade of all students who have some friends.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id)
What is the average grade of students who have friends?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id)
Find the minimum grade of students who have no friends.
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id)
What is the lowest grade of students who do not have any friends?
"Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number) "Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id "Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID
SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
Which states have both owners and professionals living there?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
Find the states where both owners and professionals live.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )
What is the average age of the dogs who have gone through any treatments?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )
Find the average age of the dogs who went through treatments.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT professional_id , last_name , cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id , T1.last_name , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) > 2
Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT professional_id , last_name , cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id , T1.last_name , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) > 2
Find the id, last name and cell phone of the professionals who live in the state of Indiana or have performed more than two treatments.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )
Which dogs have not cost their owner more than 1000 for treatment ? List the dog names .
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )
What are the names of the dogs for which the owner has not spend more than 1000 for treatment ?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs
Which first names are used for professionals or owners but are not used as dog names?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs
Find the first names that are used for professionals or owners but are not used as dog names.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT professional_id , role_code , email_address FROM Professionals EXCEPT SELECT T1.professional_id , T1.role_code , T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id
Which professional did not operate any treatment on dogs? List the professional's id, role and email.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT professional_id , role_code , email_address FROM Professionals EXCEPT SELECT T1.professional_id , T1.role_code , T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id
Give me the id, role and email of the professionals who did not perform any treatment on dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.owner_id , T2.first_name , T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1
Which owner owns the most dogs? List the owner id, first name and last name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.owner_id , T2.first_name , T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1
Return the owner id, first name and last name of the owner who has the most dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2
Which professionals have done at least two treatments? List the professional's id, role, and first name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2
What are the id, role, and first name of the professionals who have performed two or more treatments?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1
What is the name of the breed with the most dogs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1
Which breed do the most dogs have? Give me the breed name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.owner_id , T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1
Which owner has paid for the most treatments on his or her dogs? List the owner id and last name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.owner_id , T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1
Tell me the owner id and last name of the owner who spent the most on treatments of his or her dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1
What is the description of the treatment type that costs the least money in total?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1
Give me the description of the treatment type whose total cost is the lowest.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.owner_id , T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY sum(T3.cost_of_treatment) DESC LIMIT 1
Which owner has paid the largest amount of money in total for their dogs? Show the owner id and zip code.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.owner_id , T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY sum(T3.cost_of_treatment) DESC LIMIT 1
Find the owner id and zip code of the owner who spent the most money in total for his or her dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.professional_id , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2
Which professionals have done at least two types of treatments? List the professional id and cell phone.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.professional_id , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2
Find the id and cell phone of the professionals who operate two or more types of treatments.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT T1.first_name , T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment < ( SELECT avg(cost_of_treatment) FROM Treatments )
What are the first name and last name of the professionals who have done treatment with cost below average?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT T1.first_name , T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment < ( SELECT avg(cost_of_treatment) FROM Treatments )
Which professionals have operated a treatment that costs less than the average? Give me theor first names and last names.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id
List the date of each treatment, together with the first name of the professional who operated it.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id
What are the date and the operating professional's first name of each treatment?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.cost_of_treatment , T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code
List the cost of each treatment and the corresponding treatment type description.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.cost_of_treatment , T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code
What are the cost and treatment type description of each treatment?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.first_name , T1.last_name , T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id
List each owner's first name, last name, and the size of his for her dog.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.first_name , T1.last_name , T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id
What are each owner's first name, last name, and the size of their dog?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id
List pairs of the owner's first name and the dogs's name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id
What are each owner's first name and their dogs's name?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.name , T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = ( SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY count(*) ASC LIMIT 1 )
List the names of the dogs of the rarest breed and the treatment dates of them.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.name , T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = ( SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY count(*) ASC LIMIT 1 )
Which dogs are of the rarest breed? Show their names and treatment dates.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia'
Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia'
Find the first names of owners living in Virginia and the names of dogs they own.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT T1.date_arrived , T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id
What are the arriving date and the departing date of the dogs who have gone through a treatment?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT T1.date_arrived , T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id
Find the arriving date and the departing date of the dogs that received a treatment.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = ( SELECT max(age) FROM Dogs )
List the last name of the owner owning the youngest dog.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = ( SELECT max(age) FROM Dogs )
Who owns the youngest dog? Give me his or her last name.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'
List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'
What are the emails of the professionals living in either the state of Hawaii or the state of Wisconsin?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT date_arrived , date_departed FROM Dogs
What are the arriving date and the departing date of all the dogs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT date_arrived , date_departed FROM Dogs
List the arrival date and the departure date for all the dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(DISTINCT dog_id) FROM Treatments
How many dogs went through any treatments?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(DISTINCT dog_id) FROM Treatments
Count the number of dogs that went through a treatment.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(DISTINCT professional_id) FROM Treatments
How many professionals have performed any treatment to dogs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(DISTINCT professional_id) FROM Treatments
Find the number of professionals who have ever treated dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT role_code , street , city , state FROM professionals WHERE city LIKE '%West%'
Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT role_code , street , city , state FROM professionals WHERE city LIKE '%West%'
Find the role, street, city and state of the professionals living in a city that contains the substring 'West'.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT first_name , last_name , email_address FROM Owners WHERE state LIKE '%North%'
Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT first_name , last_name , email_address FROM Owners WHERE state LIKE '%North%'
Return the first name, last name and email of the owners living in a state whose name contains the substring 'North'.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )
How many dogs have an age below the average?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )
Count the number of dogs of an age below the average.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
How much does the most recent treatment cost?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
Show me the cost of the most recently performed treatment.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Dogs WHERE dog_id NOT IN ( SELECT dog_id FROM Treatments )
How many dogs have not gone through any treatment?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
select count(*) from dogs where dog_id not in ( select dog_id from treatments )
Tell me the number of dogs that have not received any treatment .
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Owners WHERE owner_id NOT IN ( SELECT owner_id FROM Dogs )
How many owners temporarily do not have any dogs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Owners WHERE owner_id NOT IN ( SELECT owner_id FROM Dogs )
Find the number of owners who do not own any dogs at this moment.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Professionals WHERE professional_id NOT IN ( SELECT professional_id FROM Treatments )
How many professionals did not operate any treatment on dogs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT count(*) FROM Professionals WHERE professional_id NOT IN ( SELECT professional_id FROM Treatments )
Find the number of professionals who have not treated any dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT name , age , weight FROM Dogs WHERE abandoned_yn = 1
List the dog name, age and weight of the dogs who have been abandoned? 1 stands for yes, and 0 stands for no.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT name , age , weight FROM Dogs WHERE abandoned_yn = 1
What are the dog name, age and weight of the dogs that were abandoned? Note that 1 stands for yes, and 0 stands for no in the tables.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT avg(age) FROM Dogs
What is the average age of all the dogs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT avg(age) FROM Dogs
Compute the average age of all the dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT max(age) FROM Dogs
What is the age of the oldest dog?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT max(age) FROM Dogs
Tell me the age of the oldest dog.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT charge_type , charge_amount FROM Charges
How much does each charge type costs? List both charge type and amount.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT charge_type , charge_amount FROM Charges
List each charge type and its amount.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT max(charge_amount) FROM Charges
How much does the most expensive charge type costs?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT max(charge_amount) FROM Charges
What is the charge amount of the most expensive charge type?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT email_address , cell_number , home_phone FROM professionals
List the email, cell phone and home phone of all the professionals.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT email_address , cell_number , home_phone FROM professionals
What are the email, cell phone and home phone of each professional?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT breed_code , size_code FROM dogs
What are all the possible breed type and size type combinations?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT breed_code , size_code FROM dogs
Find the distinct breed type and size type combinations for dogs.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT T1.first_name , T3.treatment_type_description FROM professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id JOIN Treatment_types AS T3 ON T2.treatment_type_code = T3.treatment_type_code
List the first name of all the professionals along with the description of the treatment they have done.
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code
SELECT DISTINCT T1.first_name , T3.treatment_type_description FROM professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id JOIN Treatment_types AS T3 ON T2.treatment_type_code = T3.treatment_type_code
What are each professional's first name and description of the treatment they have performed?
"Schema (values (type))": Breeds : breed_code (text) , breed_name (text) | Charges : charge_id (number) , charge_type (text) , charge_amount (number) | Sizes : size_code (text) , size_description (text) | Treatment_Types : treatment_type_code (text) , treatment_type_description (text) | Owners : owner_id (number) , first_name (text) , last_name (text) , street (text) , city (text) , state (text) , zip_code (text) , email_address (text) , home_phone (text) , cell_number (text) | Dogs : dog_id (number) , owner_id (number) , abandoned_yn (text) , breed_code (text) , size_code (text) , name (text) , age (text) , date_of_birth (time) , gender (text) , weight (text) , date_arrived (time) , date_adopted (time) , date_departed (time) | Professionals : professional_id (number) , role_code (text) , first_name (text) , street (text) , city (text) , state (text) , zip_code (text) , last_name (text) , email_address (text) , home_phone (text) , cell_number (text) | Treatments : treatment_id (number) , dog_id (number) , professional_id (number) , treatment_type_code (text) , date_of_treatment (time) , cost_of_treatment (number) "Primary Keys": Breeds : breed_code | Charges : charge_id | Sizes : size_code | Treatment_Types : treatment_type_code | Owners : owner_id | Dogs : dog_id | Professionals : professional_id | Treatments : treatment_id "Foreign Keys": Dogs : owner_id equals Owners : owner_id | Dogs : owner_id equals Owners : owner_id | Dogs : size_code equals Sizes : size_code | Dogs : breed_code equals Breeds : breed_code | Treatments : dog_id equals Dogs : dog_id | Treatments : professional_id equals Professionals : professional_id | Treatments : treatment_type_code equals Treatment_Types : treatment_type_code