cnatale/presto-athena-txt-2-sql huggingface dataset:
What is the record company used by the greatest number of orchestras?
Additional table information: table: orchestra
SQL: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
List the names of orchestras that have no performance.
Additional table information: table: orchestra
SQL: SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance)
What are the orchestras that do not have any performances?
Additional table information: table: orchestra
SQL: SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance)
Show the record companies shared by orchestras founded before 2003 and after 2003.
Additional table information: table: orchestra
SQL: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003
What are the record companies that are used by both orchestras founded before 2003 and those founded after 2003?
Additional table information: table: orchestra
SQL: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003
Find the number of orchestras whose record format is 'CD' or 'DVD'.
Additional table information: table: orchestra
SQL: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = 'CD' OR Major_Record_Format = 'DVD'
Count the number of orchestras that have CD or DVD as their record format.
Additional table information: table: orchestra
SQL: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = 'CD' OR Major_Record_Format = 'DVD'
Show the years in which orchestras that have given more than one performance are founded.
Additional table information: table: orchestra
SQL: SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1
What are years of founding for orchestras that have had more than a single performance?
Additional table information: table: orchestra
SQL: SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1
How many high schoolers are there?
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Highschooler
Count the number of high schoolers.
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Highschooler
Show the names and grades of each high schooler.
Additional table information: table: network_1
SQL: SELECT name, grade FROM Highschooler
What are the names and grades for each high schooler?
Additional table information: table: network_1
SQL: SELECT name, grade FROM Highschooler
Show all the grades of the high schoolers.
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler
What is the grade of each high schooler?
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler
What grade is Kyle in?
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler WHERE name = 'Kyle'
Return the grade for the high schooler named Kyle.
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler WHERE name = 'Kyle'
Show the names of all high schoolers in grade 10.
Additional table information: table: network_1
SQL: SELECT name FROM Highschooler WHERE grade = 10
What are the names of all high schoolers in grade 10?
Additional table information: table: network_1
SQL: SELECT name FROM Highschooler WHERE grade = 10
Show the ID of the high schooler named Kyle.
Additional table information: table: network_1
SQL: SELECT ID FROM Highschooler WHERE name = 'Kyle'
What is Kyle's id?
Additional table information: table: network_1
SQL: SELECT ID FROM Highschooler WHERE name = 'Kyle'
How many high schoolers are there in grade 9 or 10?
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Highschooler WHERE grade = 9 OR grade = 10
Count the number of high schoolers in grades 9 or 10.
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Highschooler WHERE grade = 9 OR grade = 10
Show the number of high schoolers for each grade.
Additional table information: table: network_1
SQL: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade
How many high schoolers are in each grade?
Additional table information: table: network_1
SQL: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade
Which grade has the most high schoolers?
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1
Return the grade that has the greatest number of high schoolers.
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1
Show me all grades that have at least 4 students.
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4
Which grades have 4 or more high schoolers?
Additional table information: table: network_1
SQL: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4
Show the student IDs and numbers of friends corresponding to each.
Additional table information: table: network_1
SQL: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id
How many friends does each student have?
Additional table information: table: network_1
SQL: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id
Show the names of high school students and their corresponding number of friends.
Additional table information: table: network_1
SQL: SELECT T2.name, COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
What are the names of the high schoolers and how many friends does each have?
Additional table information: table: network_1
SQL: SELECT T2.name, COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
What is the name of the high schooler who has the greatest number of friends?
Additional table information: table: network_1
SQL: 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
Return the name of the high school student with the most friends.
Additional table information: table: network_1
SQL: 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
Show the names of high schoolers who have at least 3 friends.
Additional table information: table: network_1
SQL: 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
What are the names of high schoolers who have 3 or more friends?
Additional table information: table: network_1
SQL: 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
Show the names of all of the high schooler Kyle's friends.
Additional table information: table: network_1
SQL: 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'
Return the names of friends of the high school student Kyle.
Additional table information: table: network_1
SQL: 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'
How many friends does the high school student Kyle have?
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = 'Kyle'
Count the number of friends Kyle has.
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = 'Kyle'
Show ids of all students who do not have any friends.
Additional table information: table: network_1
SQL: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend
What are the ids of high school students who do not have friends?
Additional table information: table: network_1
SQL: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend
Show names of all high school students who do not have any friends.
Additional table information: table: network_1
SQL: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id
What are the names of students who have no friends?
Additional table information: table: network_1
SQL: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id
Show the ids of high schoolers who have friends and are also liked by someone else.
Additional table information: table: network_1
SQL: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes
What are the ids of students who both have friends and are liked?
Additional table information: table: network_1
SQL: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes
Show name of all students who have some friends and also are liked by someone else.
Additional table information: table: network_1
SQL: 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?
Additional table information: table: network_1
SQL: 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
Count the number of likes for each student id.
Additional table information: table: network_1
SQL: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id
How many likes correspond to each student id?
Additional table information: table: network_1
SQL: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id
Show the names of high schoolers who have likes, and numbers of likes for each.
Additional table information: table: network_1
SQL: 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?
Additional table information: table: network_1
SQL: SELECT T2.name, COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
What is the name of the high schooler who has the greatest number of likes?
Additional table information: table: network_1
SQL: 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.
Additional table information: table: network_1
SQL: 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
Show the names of students who have at least 2 likes.
Additional table information: table: network_1
SQL: 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?
Additional table information: table: network_1
SQL: 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 a grade higher than 5 and have at least 2 friends.
Additional table information: table: network_1
SQL: 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?
Additional table information: table: network_1
SQL: 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
How many likes does Kyle have?
Additional table information: table: network_1
SQL: 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.
Additional table information: table: network_1
SQL: SELECT COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = 'Kyle'
Find the average grade of all students who have some friends.
Additional table information: table: network_1
SQL: 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?
Additional table information: table: network_1
SQL: 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 minimum grade of students who have no friends.
Additional table information: table: network_1
SQL: SELECT MIN(grade) FROM Highschooler WHERE NOT id 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?
Additional table information: table: network_1
SQL: SELECT MIN(grade) FROM Highschooler WHERE NOT id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id)
Which states have both owners and professionals living there?
Additional table information: table: dog_kennels
SQL: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
Find the states where both owners and professionals live.
Additional table information: table: dog_kennels
SQL: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
What is the average age of the dogs who have gone through any treatments?
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments)
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.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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 dogs have not cost their owner more than 1000 for treatment ? List the dog names .
Additional table information: table: dog_kennels
SQL: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000)
What are the names of the dogs for which the owner has not spend more than 1000 for treatment ?
Additional table information: table: dog_kennels
SQL: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000)
Which first names are used for professionals or owners but are not used as dog names?
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs
Which professional did not operate any treatment on dogs? List the professional's id, role and email.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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 owner owns the most dogs? List the owner id, first name and last name.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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 professionals have done at least two treatments? List the professional's id, role, and first name.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: 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 is the name of the breed with the most dogs?
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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 owner has paid for the most treatments on his or her dogs? List the owner id and last name.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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
What is the description of the treatment type that costs the least money in total?
Additional table information: table: dog_kennels
SQL: 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 NULLS FIRST LIMIT 1
Give me the description of the treatment type whose total cost is the lowest.
Additional table information: table: dog_kennels
SQL: 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 NULLS FIRST LIMIT 1
Which owner has paid the largest amount of money in total for their dogs? Show the owner id and zip code.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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 professionals have done at least two types of treatments? List the professional id and cell phone.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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
What are the first name and last name of the professionals who have done treatment with cost below average?
Additional table information: table: dog_kennels
SQL: SELECT DISTINCT T1.first_name, T1.last_name FROM Professionals AS T1, 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.
Additional table information: table: dog_kennels
SQL: SELECT DISTINCT T1.first_name, T1.last_name FROM Professionals AS T1, Treatments AS T2 WHERE cost_of_treatment < (SELECT AVG(cost_of_treatment) FROM Treatments)
List the date of each treatment, together with the first name of the professional who operated it.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: 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 cost of each treatment and the corresponding treatment type description.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: 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 each owner's first name, last name, and the size of his for her dog.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: 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 pairs of the owner's first name and the dogs's name.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id
List the names of the dogs of the rarest breed and the treatment dates of them.
Additional table information: table: dog_kennels
SQL: 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 NULLS FIRST LIMIT 1)
Which dogs are of the rarest breed? Show their names and treatment dates.
Additional table information: table: dog_kennels
SQL: 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 NULLS FIRST LIMIT 1)
Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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'
What are the arriving date and the departing date of the dogs who have gone through a treatment?
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: SELECT DISTINCT T1.date_arrived, T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id
List the last name of the owner owning the youngest dog.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: 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 emails of the professionals who live in the state of Hawaii or the state of Wisconsin.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'
What are the arriving date and the departing date of all the dogs?
Additional table information: table: dog_kennels
SQL: SELECT date_arrived, date_departed FROM Dogs
List the arrival date and the departure date for all the dogs.
Additional table information: table: dog_kennels
SQL: SELECT date_arrived, date_departed FROM Dogs
How many dogs went through any treatments?
Additional table information: table: dog_kennels
SQL: SELECT COUNT(DISTINCT dog_id) FROM Treatments
Count the number of dogs that went through a treatment.
Additional table information: table: dog_kennels
SQL: SELECT COUNT(DISTINCT dog_id) FROM Treatments
How many professionals have performed any treatment to dogs?
Additional table information: table: dog_kennels
SQL: SELECT COUNT(DISTINCT professional_id) FROM Treatments
Find the number of professionals who have ever treated dogs.
Additional table information: table: dog_kennels
SQL: SELECT COUNT(DISTINCT professional_id) FROM Treatments
Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state.
Additional table information: table: dog_kennels
SQL: 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'.
Additional table information: table: dog_kennels
SQL: SELECT role_code, street, city, state FROM professionals WHERE city LIKE '%West%'
Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email.
Additional table information: table: dog_kennels
SQL: 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'.
Additional table information: table: dog_kennels
SQL: SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%'
How many dogs have an age below the average?
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Dogs WHERE age < (SELECT AVG(age) FROM Dogs)
Count the number of dogs of an age below the average.
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Dogs WHERE age < (SELECT AVG(age) FROM Dogs)
How much does the most recent treatment cost?
Additional table information: table: dog_kennels
SQL: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
Show me the cost of the most recently performed treatment.
Additional table information: table: dog_kennels
SQL: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
How many dogs have not gone through any treatment?
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Dogs WHERE NOT dog_id IN (SELECT dog_id FROM Treatments)
Tell me the number of dogs that have not received any treatment .
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments)
How many owners temporarily do not have any dogs?
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs)
Find the number of owners who do not own any dogs at this moment.
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs)
How many professionals did not operate any treatment on dogs?
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments)
Find the number of professionals who have not treated any dogs.
Additional table information: table: dog_kennels
SQL: SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments)
List the dog name, age and weight of the dogs who have been abandoned? 1 stands for yes, and 0 stands for no.
Additional table information: table: dog_kennels
SQL: 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.
Additional table information: table: dog_kennels
SQL: SELECT name, age, weight FROM Dogs WHERE abandoned_yn = 1
What is the average age of all the dogs?
Additional table information: table: dog_kennels
SQL: SELECT AVG(age) FROM Dogs
Compute the average age of all the dogs.
Additional table information: table: dog_kennels
SQL: SELECT AVG(age) FROM Dogs
What is the age of the oldest dog?
Additional table information: table: dog_kennels
SQL: SELECT MAX(age) FROM Dogs
Tell me the age of the oldest dog.
Additional table information: table: dog_kennels
SQL: SELECT MAX(age) FROM Dogs
How much does each charge type costs? List both charge type and amount.
Additional table information: table: dog_kennels
SQL: SELECT charge_type, charge_amount FROM Charges
List each charge type and its amount.
Additional table information: table: dog_kennels
SQL: SELECT charge_type, charge_amount FROM Charges
How much does the most expensive charge type costs?
Additional table information: table: dog_kennels
SQL: SELECT MAX(charge_amount) FROM Charges
What is the charge amount of the most expensive charge type?
Additional table information: table: dog_kennels
SQL: SELECT MAX(charge_amount) FROM Charges
List the email, cell phone and home phone of all the professionals.
Additional table information: table: dog_kennels
SQL: SELECT email_address, cell_number, home_phone FROM professionals
What are the email, cell phone and home phone of each professional?
Additional table information: table: dog_kennels
SQL: SELECT email_address, cell_number, home_phone FROM professionals
What are all the possible breed type and size type combinations?
Additional table information: table: dog_kennels
SQL: SELECT DISTINCT breed_code, size_code FROM dogs
Find the distinct breed type and size type combinations for dogs.
Additional table information: table: dog_kennels
SQL: SELECT DISTINCT breed_code, size_code FROM dogs
List the first name of all the professionals along with the description of the treatment they have done.
Additional table information: table: dog_kennels
SQL: 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?
Additional table information: table: dog_kennels
SQL: 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
How many singers are there?
Additional table information: table: singer
SQL: SELECT COUNT(*) FROM singer
What is the count of singers?
Additional table information: table: singer
SQL: SELECT COUNT(*) FROM singer
List the name of singers in ascending order of net worth.
Additional table information: table: singer
SQL: SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC NULLS FIRST
What are the names of singers ordered by ascending net worth?
Additional table information: table: singer
SQL: SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC NULLS FIRST
What are the birth year and citizenship of singers?
Additional table information: table: singer
SQL: SELECT Birth_Year, Citizenship FROM singer
What are the birth years and citizenships of the singers?
Additional table information: table: singer
SQL: SELECT Birth_Year, Citizenship FROM singer
List the name of singers whose citizenship is not 'France'.
Additional table information: table: singer
SQL: SELECT Name FROM singer WHERE Citizenship <> 'France'
What are the names of the singers who are not French citizens?
Additional table information: table: singer
SQL: SELECT Name FROM singer WHERE Citizenship <> 'France'
Show the name of singers whose birth year is either 1948 or 1949?
Additional table information: table: singer
SQL: SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949
What are the names of the singers whose birth years are either 1948 or 1949?
Additional table information: table: singer
SQL: SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949
What is the name of the singer with the largest net worth?
Additional table information: table: singer
SQL: SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1
What is the name of the singer who is worth the most?
Additional table information: table: singer
SQL: SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1
Show different citizenship of singers and the number of singers of each citizenship.
Additional table information: table: singer
SQL: SELECT Citizenship, COUNT(*) FROM singer GROUP BY Citizenship
For each citizenship, how many singers are from that country?
Additional table information: table: singer
SQL: SELECT Citizenship, COUNT(*) FROM singer GROUP BY Citizenship
Please show the most common citizenship of singers.
Additional table information: table: singer
SQL: SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC LIMIT 1
What is the most common singer citizenship ?
Additional table information: table: singer
SQL: SELECT citizenship FROM singer GROUP BY citizenship ORDER BY COUNT(*) DESC LIMIT 1
Show different citizenships and the maximum net worth of singers of each citizenship.
Additional table information: table: singer
SQL: SELECT Citizenship, MAX(Net_Worth_Millions) FROM singer GROUP BY Citizenship
For each citizenship, what is the maximum net worth?
Additional table information: table: singer
SQL: SELECT Citizenship, MAX(Net_Worth_Millions) FROM singer GROUP BY Citizenship
Show titles of songs and names of singers.
Additional table information: table: singer
SQL: SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID
What are the song titles and singer names?
Additional table information: table: singer
SQL: SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID
Show distinct names of singers that have songs with sales more than 300000.
Additional table information: table: singer
SQL: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000
what are the different names of the singers that have sales more than 300000?
Additional table information: table: singer
SQL: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000
Show the names of singers that have more than one song.
Additional table information: table: singer
SQL: SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*) > 1
What are the names of the singers that have more than one songs?
Additional table information: table: singer
SQL: SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*) > 1
Show the names of singers and the total sales of their songs.
Additional table information: table: singer
SQL: SELECT T1.Name, SUM(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name
For each singer name, what is the total sales for their songs?
Additional table information: table: singer
SQL: SELECT T1.Name, SUM(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name
List the name of singers that do not have any song.
Additional table information: table: singer
SQL: SELECT Name FROM singer WHERE NOT Singer_ID IN (SELECT Singer_ID FROM song)
What is the sname of every sing that does not have any song?
Additional table information: table: singer
SQL: SELECT Name FROM singer WHERE NOT Singer_ID IN (SELECT Singer_ID FROM song)
Show the citizenship shared by singers with birth year before 1945 and after 1955.
Additional table information: table: singer
SQL: SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955
What are the citizenships that are shared by singers with a birth year before 1945 and after 1955?
Additional table information: table: singer
SQL: SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955
How many available features are there in total?
Additional table information: table: real_estate_properties
SQL: SELECT COUNT(*) FROM Other_Available_Features
What is the feature type name of feature AirCon?
Additional table information: table: real_estate_properties
SQL: SELECT T2.feature_type_name FROM Other_Available_Features AS T1 JOIN Ref_Feature_Types AS T2 ON T1.feature_type_code = T2.feature_type_code WHERE T1.feature_name = 'AirCon'
Show the property type descriptions of properties belonging to that code.
Additional table information: table: real_estate_properties
SQL: SELECT T2.property_type_description FROM Properties AS T1 JOIN Ref_Property_Types AS T2 ON T1.property_type_code = T2.property_type_code GROUP BY T1.property_type_code
What are the names of properties that are either houses or apartments with more than 1 room?
Additional table information: table: real_estate_properties
SQL: SELECT property_name FROM Properties WHERE property_type_code = 'House' UNION SELECT property_name FROM Properties WHERE property_type_code = 'Apartment' AND room_count > 1
What position does the player who played for butler cc (ks) play?
Additional table information: table: "canadian_football"."toronto"
columns: player, player_number, nationality, position, years_in_toronto, school_club_team
SQL: SELECT position FROM "canadian_football"."toronto" WHERE school_club_team = 'Butler CC (KS)'
How many schools did player number 3 play at?
Additional table information: table: "canadian_football"."toronto"
columns: player, player_number, nationality, position, years_in_toronto, school_club_team
SQL: SELECT COUNT school_club_team FROM "canadian_football"."toronto" WHERE player_number = '3'
What school did player number 21 play for?
Additional table information: table: "canadian_football"."toronto"
columns: player, player_number, nationality, position, years_in_toronto, school_club_team
SQL: SELECT school_club_team FROM "canadian_football"."toronto" WHERE player_number = '21'
Who is the player that wears number 42?
Additional table information: table: "canadian_football"."toronto"
columns: player, player_number, nationality, position, years_in_toronto, school_club_team
SQL: SELECT player FROM "canadian_football"."toronto" WHERE player_number = '42'
What player played guard for toronto in 1996-97?
Additional table information: table: "canadian_football"."toronto"
columns: player, player_number, nationality, position, years_in_toronto, school_club_team
SQL: SELECT player FROM "canadian_football"."toronto" WHERE position = 'Guard' AND years_in_toronto = '1996-97'
Who are all of the players on the Westchester High School club team?
Additional table information: table: "canadian_football"."players"
columns: player, player_number, nationality, Position, years_in_toronto, school_club_team
SQL: SELECT player FROM "canadian_football"."players" WHERE school_club_team = 'Westchester High School'
What school/club team is Amir Johnson on?
Additional table information: table: "canadian_football"."players"
columns: player, player_number, nationality, Position, years_in_toronto, school_club_team
SQL: SELECT school_club_team FROM "canadian_football"."players" WHERE player = 'Amir Johnson'
What are the total amount of numbers on the Toronto team in 2005-06?
Additional table information: table: "canadian_football"."players"
columns: player, player_number, nationality, Position, years_in_toronto, school_club_team
SQL: SELECT COUNT player_number FROM "canadian_football"."players" WHERE years_in_toronto = '2005-06'
What are the total number of positions on the Toronto team in 2006-07?
Additional table information: table: "canadian_football"."players"
columns: player, player_number, nationality, Position, years_in_toronto, school_club_team
SQL: SELECT COUNT Position FROM "canadian_football"."players" WHERE years_in_toronto = '2006-07'
What are the nationality of the players on the Fresno State school/club team?
Additional table information: table: "canadian_football"."players"
columns: player, player_number, nationality, Position, years_in_toronto, school_club_team
SQL: SELECT nationality FROM "canadian_football"."players" WHERE school_club_team = 'Fresno State'
What school/club team is Trey Johnson on?
Additional table information: table: "canadian_football"."players"
columns: player, player_number, nationality, Position, years_in_toronto, school_club_team
SQL: SELECT school_club_team FROM "canadian_football"."players" WHERE player = 'Trey Johnson'