db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
network_1
select id from highschooler where name = 'kyle'
Question: show the id of the high schooler named kyle. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
show the id of the high schooler named kyle.
network_1
select id from highschooler where name = 'kyle'
Question: what is kyle's id? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
what is kyle's id?
network_1
select count(*) from highschooler where grade = 9 or grade = 10
Question: how many high schoolers are there in grade 9 or 10? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
how many high schoolers are there in grade 9 or 10?
network_1
select count(*) from highschooler where grade = 9 or grade = 10
Question: count the number of high schoolers in grades 9 or 10. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.I...
count the number of high schoolers in grades 9 or 10.
network_1
select grade , count(*) from highschooler group by grade
Question: show the number of high schoolers for each grade. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
show the number of high schoolers for each grade.
network_1
select grade , count(*) from highschooler group by grade
Question: how many high schoolers are in each grade? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
how many high schoolers are in each grade?
network_1
select grade from highschooler group by grade order by count(*) desc limit 1
Question: which grade has the most high schoolers? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
which grade has the most high schoolers?
network_1
select grade from highschooler group by grade order by count(*) desc limit 1
Question: return the grade that has the greatest number of high schoolers. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hig...
return the grade that has the greatest number of high schoolers.
network_1
select grade from highschooler group by grade having count(*) >= 4
Question: show me all grades that have at least 4 students. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
show me all grades that have at least 4 students.
network_1
select grade from highschooler group by grade having count(*) >= 4
Question: which grades have 4 or more high schoolers? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
which grades have 4 or more high schoolers?
network_1
select student_id , count(*) from friend group by student_id
Question: show the student ids and numbers of friends corresponding to each. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = H...
show the student ids and numbers of friends corresponding to each.
network_1
select student_id , count(*) from friend group by student_id
Question: how many friends does each student have? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
how many friends does each student have?
network_1
select t2.name , count(*) from friend as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id
Question: show the names of high school students and their corresponding number of friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Lik...
show the names of high school students and their corresponding number of friends.
network_1
select t2.name , count(*) from friend as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id
Question: what are the names of the high schoolers and how many friends does each have? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.l...
what are the names of the high schoolers and how many friends does each have?
network_1
select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id order by count(*) desc limit 1
Question: what is the name of the high schooler who has the greatest number of friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.l...
what is the name of the high schooler who has the greatest number of friends?
network_1
select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id order by count(*) desc limit 1
Question: return the name of the high school student with the most friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hi...
return the name of the high school student with the most friends.
network_1
select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id having count(*) >= 3
Question: show the names of high schoolers who have at least 3 friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highsc...
show the names of high schoolers who have at least 3 friends.
network_1
select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id having count(*) >= 3
Question: what are the names of high schoolers who have 3 or more friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hig...
what are the names of high schoolers who have 3 or more friends?
network_1
select t3.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id join highschooler as t3 on t1.friend_id = t3.id where t2.name = 'kyle'
Question: show the names of all of the high schooler kyle's friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschoo...
show the names of all of the high schooler kyle's friends.
network_1
select t3.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id join highschooler as t3 on t1.friend_id = t3.id where t2.name = 'kyle'
Question: return the names of friends of the high school student kyle. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highsch...
return the names of friends of the high school student kyle.
network_1
select count(*) from friend as t1 join highschooler as t2 on t1.student_id = t2.id where t2.name = 'kyle'
Question: how many friends does the high school student kyle have? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschoole...
how many friends does the high school student kyle have?
network_1
select count(*) from friend as t1 join highschooler as t2 on t1.student_id = t2.id where t2.name = 'kyle'
Question: count the number of friends kyle has. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
count the number of friends kyle has.
network_1
select id from highschooler except select student_id from friend
Question: show ids of all students who do not have any friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.I...
show ids of all students who do not have any friends.
network_1
select id from highschooler except select student_id from friend
Question: what are the ids of high school students who do not have friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hi...
what are the ids of high school students who do not have friends?
network_1
select name from highschooler except select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id
Question: show names of all high school students who do not have any friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = ...
show names of all high school students who do not have any friends.
network_1
select name from highschooler except select t2.name from friend as t1 join highschooler as t2 on t1.student_id = t2.id
Question: what are the names of students who have no friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
what are the names of students who have no friends?
network_1
select student_id from friend intersect select liked_id from likes
Question: show the ids of high schoolers who have friends and are also liked by someone else. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, L...
show the ids of high schoolers who have friends and are also liked by someone else.
network_1
select student_id from friend intersect select liked_id from likes
Question: what are the ids of students who both have friends and are liked? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hi...
what are the ids of students who both have friends and are liked?
network_1
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
Question: show name of all students who have some friends and also are liked by someone else. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, L...
show name of all students who have some friends and also are liked by someone else.
network_1
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
Question: what are the names of high schoolers who both have friends and are liked? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked...
what are the names of high schoolers who both have friends and are liked?
network_1
select student_id , count(*) from likes group by student_id
Question: count the number of likes for each student id. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
count the number of likes for each student id.
network_1
select student_id , count(*) from likes group by student_id
Question: how many likes correspond to each student id? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
how many likes correspond to each student id?
network_1
select t2.name , count(*) from likes as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id
Question: show the names of high schoolers who have likes, and numbers of likes for each. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes...
show the names of high schoolers who have likes, and numbers of likes for each.
network_1
select t2.name , count(*) from likes as t1 join highschooler as t2 on t1.student_id = t2.id group by t1.student_id
Question: what are the names of high schoolers who have likes, and how many likes does each have? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.I...
what are the names of high schoolers who have likes, and how many likes does each have?
network_1
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
Question: what is the name of the high schooler who has the greatest number of likes? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.lik...
what is the name of the high schooler who has the greatest number of likes?
network_1
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
Question: give the name of the student with the most likes. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
give the name of the student with the most likes.
network_1
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
Question: show the names of students who have at least 2 likes. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.I...
show the names of students who have at least 2 likes.
network_1
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
Question: what are the names of students who have 2 or more likes? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschoole...
what are the names of students who have 2 or more likes?
network_1
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
Question: show the names of students who have a grade higher than 5 and have at least 2 friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID...
show the names of students who have a grade higher than 5 and have at least 2 friends.
network_1
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
Question: what are the names of high schoolers who have a grade of over 5 and have 2 or more friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschool...
what are the names of high schoolers who have a grade of over 5 and have 2 or more friends?
network_1
select count(*) from likes as t1 join highschooler as t2 on t1.student_id = t2.id where t2.name = 'kyle'
Question: how many likes does kyle have? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler.ID,
how many likes does kyle have?
network_1
select count(*) from likes as t1 join highschooler as t2 on t1.student_id = t2.id where t2.name = 'kyle'
Question: return the number of likes that the high schooler named kyle has. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hi...
return the number of likes that the high schooler named kyle has.
network_1
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)
Question: find the average grade of all students who have some friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highsc...
find the average grade of all students who have some friends.
network_1
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)
Question: what is the average grade of students who have friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler...
what is the average grade of students who have friends?
network_1
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)
Question: find the minimum grade of students who have no friends. | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Highschooler...
find the minimum grade of students who have no friends.
network_1
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)
Question: what is the lowest grade of students who do not have any friends? | Tables: Highschooler -> ID, name, grade. Friend -> student_id, friend_id. Likes -> student_id, liked_id. | Joins: Friend.friend_id = Highschooler.ID, Friend.student_id = Highschooler.ID, Likes.student_id = Highschooler.ID, Likes.liked_id = Hi...
what is the lowest grade of students who do not have any friends?
dog_kennels
select state from owners intersect select state from professionals
Question: which states have both owners and professionals living there? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, stree...
which states have both owners and professionals living there?
dog_kennels
select state from owners intersect select state from professionals
Question: find the states where both owners and professionals live. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, c...
find the states where both owners and professionals live.
dog_kennels
select avg(age) from dogs where dog_id in ( select dog_id from treatments )
Question: what is the average age of the dogs who have gone through any treatments? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last...
what is the average age of the dogs who have gone through any treatments?
dog_kennels
select avg(age) from dogs where dog_id in ( select dog_id from treatments )
Question: find the average age of the dogs who went through treatments. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, stree...
find the average age of the dogs who went through treatments.
dog_kennels
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
Question: 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. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type...
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.
dog_kennels
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
Question: 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. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, tr...
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.
dog_kennels
select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )
Question: which dogs have not cost their owner more than 1000 for treatment ? list the dog names . | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, f...
which dogs have not cost their owner more than 1000 for treatment ? list the dog names .
dog_kennels
select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )
Question: what are the names of the dogs for which the owner has not spend more than 1000 for treatment ? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owne...
what are the names of the dogs for which the owner has not spend more than 1000 for treatment ?
dog_kennels
select first_name from professionals union select first_name from owners except select name from dogs
Question: which first names are used for professionals or owners but are not used as dog names? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, firs...
which first names are used for professionals or owners but are not used as dog names?
dog_kennels
select first_name from professionals union select first_name from owners except select name from dogs
Question: find the first names that are used for professionals or owners but are not used as dog names. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_...
find the first names that are used for professionals or owners but are not used as dog names.
dog_kennels
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
Question: which professional did not operate any treatment on dogs? list the professional's id, role and email. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -...
which professional did not operate any treatment on dogs? list the professional's id, role and email.
dog_kennels
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
Question: give me the id, role and email of the professionals who did not perform any treatment on dogs. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner...
give me the id, role and email of the professionals who did not perform any treatment on dogs.
dog_kennels
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
Question: which owner owns the most dogs? list the owner id, first name and last name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, l...
which owner owns the most dogs? list the owner id, first name and last name.
dog_kennels
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
Question: return the owner id, first name and last name of the owner who has the most dogs. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_na...
return the owner id, first name and last name of the owner who has the most dogs.
dog_kennels
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
Question: which professionals have done at least two treatments? list the professional's id, role, and first name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owner...
which professionals have done at least two treatments? list the professional's id, role, and first name.
dog_kennels
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
Question: what are the id, role, and first name of the professionals who have performed two or more treatments? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -...
what are the id, role, and first name of the professionals who have performed two or more treatments?
dog_kennels
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
Question: what is the name of the breed with the most dogs? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, city, sta...
what is the name of the breed with the most dogs?
dog_kennels
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
Question: which breed do the most dogs have? give me the breed name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, ...
which breed do the most dogs have? give me the breed name.
dog_kennels
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
Question: which owner has paid for the most treatments on his or her dogs? list the owner id and last name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> ow...
which owner has paid for the most treatments on his or her dogs? list the owner id and last name.
dog_kennels
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
Question: tell me the owner id and last name of the owner who spent the most on treatments of his or her dogs. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners ->...
tell me the owner id and last name of the owner who spent the most on treatments of his or her dogs.
dog_kennels
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
Question: what is the description of the treatment type that costs the least money in total? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_n...
what is the description of the treatment type that costs the least money in total?
dog_kennels
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
Question: give me the description of the treatment type whose total cost is the lowest. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, ...
give me the description of the treatment type whose total cost is the lowest.
dog_kennels
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
Question: which owner has paid the largest amount of money in total for their dogs? show the owner id and zip code. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owne...
which owner has paid the largest amount of money in total for their dogs? show the owner id and zip code.
dog_kennels
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
Question: find the owner id and zip code of the owner who spent the most money in total for his or her dogs. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> o...
find the owner id and zip code of the owner who spent the most money in total for his or her dogs.
dog_kennels
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
Question: which professionals have done at least two types of treatments? list the professional id and cell phone. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owner...
which professionals have done at least two types of treatments? list the professional id and cell phone.
dog_kennels
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
Question: find the id and cell phone of the professionals who operate two or more types of treatments. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_i...
find the id and cell phone of the professionals who operate two or more types of treatments.
dog_kennels
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 )
Question: what are the first name and last name of the professionals who have done treatment with cost below average? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Ow...
what are the first name and last name of the professionals who have done treatment with cost below average?
dog_kennels
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 )
Question: which professionals have operated a treatment that costs less than the average? give me theor first names and last names. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_d...
which professionals have operated a treatment that costs less than the average? give me theor first names and last names.
dog_kennels
select t1.date_of_treatment , t2.first_name from treatments as t1 join professionals as t2 on t1.professional_id = t2.professional_id
Question: list the date of each treatment, together with the first name of the professional who operated it. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> o...
list the date of each treatment, together with the first name of the professional who operated it.
dog_kennels
select t1.date_of_treatment , t2.first_name from treatments as t1 join professionals as t2 on t1.professional_id = t2.professional_id
Question: what are the date and the operating professional's first name of each treatment? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_nam...
what are the date and the operating professional's first name of each treatment?
dog_kennels
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
Question: list the cost of each treatment and the corresponding treatment type description. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_na...
list the cost of each treatment and the corresponding treatment type description.
dog_kennels
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
Question: what are the cost and treatment type description of each treatment? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name,...
what are the cost and treatment type description of each treatment?
dog_kennels
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
Question: list each owner's first name, last name, and the size of his for her dog. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last...
list each owner's first name, last name, and the size of his for her dog.
dog_kennels
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
Question: what are each owner's first name, last name, and the size of their dog? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_n...
what are each owner's first name, last name, and the size of their dog?
dog_kennels
select t1.first_name , t2.name from owners as t1 join dogs as t2 on t1.owner_id = t2.owner_id
Question: list pairs of the owner's first name and the dogs's name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, c...
list pairs of the owner's first name and the dogs's name.
dog_kennels
select t1.first_name , t2.name from owners as t1 join dogs as t2 on t1.owner_id = t2.owner_id
Question: what are each owner's first name and their dogs's name? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, cit...
what are each owner's first name and their dogs's name?
dog_kennels
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 )
Question: list the names of the dogs of the rarest breed and the treatment dates of them. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name...
list the names of the dogs of the rarest breed and the treatment dates of them.
dog_kennels
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 )
Question: which dogs are of the rarest breed? show their names and treatment dates. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last...
which dogs are of the rarest breed? show their names and treatment dates.
dog_kennels
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'
Question: which dogs are owned by someone who lives in virginia? list the owner's first name and the dog's name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners ...
which dogs are owned by someone who lives in virginia? list the owner's first name and the dog's name.
dog_kennels
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'
Question: find the first names of owners living in virginia and the names of dogs they own. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_na...
find the first names of owners living in virginia and the names of dogs they own.
dog_kennels
select distinct t1.date_arrived , t1.date_departed from dogs as t1 join treatments as t2 on t1.dog_id = t2.dog_id
Question: what are the arriving date and the departing date of the dogs who have gone through a treatment? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> own...
what are the arriving date and the departing date of the dogs who have gone through a treatment?
dog_kennels
select distinct t1.date_arrived , t1.date_departed from dogs as t1 join treatments as t2 on t1.dog_id = t2.dog_id
Question: find the arriving date and the departing date of the dogs that received a treatment. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first...
find the arriving date and the departing date of the dogs that received a treatment.
dog_kennels
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 )
Question: list the last name of the owner owning the youngest dog. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, ci...
list the last name of the owner owning the youngest dog.
dog_kennels
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 )
Question: who owns the youngest dog? give me his or her last name. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, ci...
who owns the youngest dog? give me his or her last name.
dog_kennels
select email_address from professionals where state = 'hawaii' or state = 'wisconsin'
Question: list the emails of the professionals who live in the state of hawaii or the state of wisconsin. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owne...
list the emails of the professionals who live in the state of hawaii or the state of wisconsin.
dog_kennels
select email_address from professionals where state = 'hawaii' or state = 'wisconsin'
Question: what are the emails of the professionals living in either the state of hawaii or the state of wisconsin? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owner...
what are the emails of the professionals living in either the state of hawaii or the state of wisconsin?
dog_kennels
select date_arrived , date_departed from dogs
Question: what are the arriving date and the departing date of all the dogs? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, ...
what are the arriving date and the departing date of all the dogs?
dog_kennels
select date_arrived , date_departed from dogs
Question: list the arrival date and the departure date for all the dogs. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, stre...
list the arrival date and the departure date for all the dogs.
dog_kennels
select count(distinct dog_id) from treatments
Question: how many dogs went through any treatments? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, city, state, zip...
how many dogs went through any treatments?
dog_kennels
select count(distinct dog_id) from treatments
Question: count the number of dogs that went through a treatment. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street, cit...
count the number of dogs that went through a treatment.
dog_kennels
select count(distinct professional_id) from treatments
Question: how many professionals have performed any treatment to dogs? | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street...
how many professionals have performed any treatment to dogs?
dog_kennels
select count(distinct professional_id) from treatments
Question: find the number of professionals who have ever treated dogs. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description. Owners -> owner_id, first_name, last_name, street...
find the number of professionals who have ever treated dogs.
dog_kennels
select role_code , street , city , state from professionals where city like '%west%'
Question: which professionals live in a city containing the substring 'west'? list his or her role, street, city and state. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_descripti...
which professionals live in a city containing the substring 'west'? list his or her role, street, city and state.
dog_kennels
select role_code , street , city , state from professionals where city like '%west%'
Question: find the role, street, city and state of the professionals living in a city that contains the substring 'west'. | Tables: Breeds -> breed_code, breed_name. Charges -> charge_id, charge_type, charge_amount. Sizes -> size_code, size_description. Treatment_Types -> treatment_type_code, treatment_type_description...
find the role, street, city and state of the professionals living in a city that contains the substring 'west'.