Question:
What is the total population and average area of countries in the continent of North America whose area is bigger than 3000 ?
Additional table information: table: world_1

Answer: SELECT SUM(population), AVG(surfacearea) FROM country WHERE continent = 'north america' AND surfacearea > 3000


Question:
Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 .
Additional table information: table: world_1

Answer: SELECT SUM(population), AVG(surfacearea) FROM country WHERE continent = 'north america' AND surfacearea > 3000


Question:
What are the cities whose population is between 160000 and 900000?
Additional table information: table: world_1

Answer: SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000


Question:
Return the names of cities that have a population between 160000 and 900000 .
Additional table information: table: world_1

Answer: SELECT name FROM city WHERE population BETWEEN 160000 AND 900000


Question:
Which language is spoken by the largest number of countries?
Additional table information: table: world_1

Answer: SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY COUNT(*) DESC LIMIT 1


Question:
Give the language that is spoken in the most countries.
Additional table information: table: world_1

Answer: SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the language spoken by the largest percentage of people in each country?
Additional table information: table: world_1

Answer: SELECT LANGUAGE, CountryCode, MAX(Percentage) FROM countrylanguage GROUP BY CountryCode


Question:
What are the country codes of the different countries, and what are the languages spoken by the greatest percentage of people for each?
Additional table information: table: world_1

Answer: SELECT LANGUAGE, CountryCode, MAX(Percentage) FROM countrylanguage GROUP BY CountryCode


Question:
What is the total number of countries where Spanish is spoken by the largest percentage of people?
Additional table information: table: world_1

Answer: SELECT COUNT(*), MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = 'Spanish' GROUP BY CountryCode


Question:
Count the number of countries for which Spanish is the predominantly spoken language.
Additional table information: table: world_1

Answer: SELECT COUNT(*), MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = 'Spanish' GROUP BY CountryCode


Question:
What are the codes of countries where Spanish is spoken by the largest percentage of people?
Additional table information: table: world_1

Answer: SELECT CountryCode, MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = 'Spanish' GROUP BY CountryCode


Question:
Return the codes of countries for which Spanish is the predominantly spoken language.
Additional table information: table: world_1

Answer: SELECT CountryCode, MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = 'Spanish' GROUP BY CountryCode


Question:
How many conductors are there?
Additional table information: table: orchestra

Answer: SELECT COUNT(*) FROM conductor


Question:
Count the number of conductors.
Additional table information: table: orchestra

Answer: SELECT COUNT(*) FROM conductor


Question:
List the names of conductors in ascending order of age.
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor ORDER BY Age ASC NULLS FIRST


Question:
What are the names of conductors, ordered by age?
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor ORDER BY Age ASC NULLS FIRST


Question:
What are the names of conductors whose nationalities are not 'USA'?
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor WHERE Nationality <> 'USA'


Question:
Return the names of conductors that do not have the nationality 'USA'.
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor WHERE Nationality <> 'USA'


Question:
What are the record companies of orchestras in descending order of years in which they were founded?
Additional table information: table: orchestra

Answer: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC


Question:
Return the record companies of orchestras, sorted descending by the years in which they were founded.
Additional table information: table: orchestra

Answer: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC


Question:
What is the average attendance of shows?
Additional table information: table: orchestra

Answer: SELECT AVG(Attendance) FROM SHOW


Question:
Return the average attendance across all shows.
Additional table information: table: orchestra

Answer: SELECT AVG(Attendance) FROM SHOW


Question:
What are the maximum and minimum share of performances whose type is not 'Live final'.
Additional table information: table: orchestra

Answer: SELECT MAX(SHARE), MIN(SHARE) FROM performance WHERE TYPE <> 'Live final'


Question:
Return the maximum and minimum shares for performances that do not have the type 'Live final'.
Additional table information: table: orchestra

Answer: SELECT MAX(SHARE), MIN(SHARE) FROM performance WHERE TYPE <> 'Live final'


Question:
How many different nationalities do conductors have?
Additional table information: table: orchestra

Answer: SELECT COUNT(DISTINCT Nationality) FROM conductor


Question:
Count the number of different nationalities of conductors.
Additional table information: table: orchestra

Answer: SELECT COUNT(DISTINCT Nationality) FROM conductor


Question:
List names of conductors in descending order of years of work.
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor ORDER BY Year_of_Work DESC


Question:
What are the names of conductors, sorted descending by the number of years they have worked?
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor ORDER BY Year_of_Work DESC


Question:
List the name of the conductor with the most years of work.
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1


Question:
What is the name of the conductor who has worked the greatest number of years?
Additional table information: table: orchestra

Answer: SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1


Question:
Show the names of conductors and the orchestras they have conducted.
Additional table information: table: orchestra

Answer: SELECT T1.Name, T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID


Question:
What are the names of conductors as well as the corresonding orchestras that they have conducted?
Additional table information: table: orchestra

Answer: SELECT T1.Name, T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID


Question:
Show the names of conductors that have conducted more than one orchestras.
Additional table information: table: orchestra

Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1


Question:
What are the names of conductors who have conducted at more than one orchestra?
Additional table information: table: orchestra

Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1


Question:
Show the name of the conductor that has conducted the most number of orchestras.
Additional table information: table: orchestra

Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of the conductor who has conducted the most orchestras?
Additional table information: table: orchestra

Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Please show the name of the conductor that has conducted orchestras founded after 2008.
Additional table information: table: orchestra

Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008


Question:
What are the names of conductors who have conducted orchestras founded after the year 2008?
Additional table information: table: orchestra

Answer: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008


Question:
Please show the different record companies and the corresponding number of orchestras.
Additional table information: table: orchestra

Answer: SELECT Record_Company, COUNT(*) FROM orchestra GROUP BY Record_Company


Question:
How many orchestras does each record company manage?
Additional table information: table: orchestra

Answer: SELECT Record_Company, COUNT(*) FROM orchestra GROUP BY Record_Company


Question:
Please show the record formats of orchestras in ascending order of count.
Additional table information: table: orchestra

Answer: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC NULLS FIRST


Question:
What are the major record formats of orchestras, sorted by their frequency?
Additional table information: table: orchestra

Answer: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC NULLS FIRST


Question:
List the record company shared by the most number of orchestras.
Additional table information: table: orchestra

Answer: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the record company used by the greatest number of orchestras?
Additional table information: table: orchestra

Answer: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the names of orchestras that have no performance.
Additional table information: table: orchestra

Answer: SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance)


Question:
What are the orchestras that do not have any performances?
Additional table information: table: orchestra

Answer: SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance)


Question:
Show the record companies shared by orchestras founded before 2003 and after 2003.
Additional table information: table: orchestra

Answer: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003


Question:
What are the record companies that are used by both orchestras founded before 2003 and those founded after 2003?
Additional table information: table: orchestra

Answer: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003


Question:
Find the number of orchestras whose record format is 'CD' or 'DVD'.
Additional table information: table: orchestra

Answer: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = 'CD' OR Major_Record_Format = 'DVD'


Question:
Count the number of orchestras that have CD or DVD as their record format.
Additional table information: table: orchestra

Answer: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = 'CD' OR Major_Record_Format = 'DVD'


Question:
Show the years in which orchestras that have given more than one performance are founded.
Additional table information: table: orchestra

Answer: 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


Question:
What are years of founding for orchestras that have had more than a single performance?
Additional table information: table: orchestra

Answer: 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


Question:
How many high schoolers are there?
Additional table information: table: network_1

Answer: SELECT COUNT(*) FROM Highschooler


Question:
Count the number of high schoolers.
Additional table information: table: network_1

Answer: SELECT COUNT(*) FROM Highschooler


Question:
Show the names and grades of each high schooler.
Additional table information: table: network_1

Answer: SELECT name, grade FROM Highschooler


Question:
What are the names and grades for each high schooler?
Additional table information: table: network_1

Answer: SELECT name, grade FROM Highschooler


Question:
Show all the grades of the high schoolers.
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler


Question:
What is the grade of each high schooler?
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler


Question:
What grade is Kyle in?
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler WHERE name = 'Kyle'


Question:
Return the grade for the high schooler named Kyle.
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler WHERE name = 'Kyle'


Question:
Show the names of all high schoolers in grade 10.
Additional table information: table: network_1

Answer: SELECT name FROM Highschooler WHERE grade = 10


Question:
What are the names of all high schoolers in grade 10?
Additional table information: table: network_1

Answer: SELECT name FROM Highschooler WHERE grade = 10


Question:
Show the ID of the high schooler named Kyle.
Additional table information: table: network_1

Answer: SELECT ID FROM Highschooler WHERE name = 'Kyle'


Question:
What is Kyle's id?
Additional table information: table: network_1

Answer: SELECT ID FROM Highschooler WHERE name = 'Kyle'


Question:
How many high schoolers are there in grade 9 or 10?
Additional table information: table: network_1

Answer: SELECT COUNT(*) FROM Highschooler WHERE grade = 9 OR grade = 10


Question:
Count the number of high schoolers in grades 9 or 10.
Additional table information: table: network_1

Answer: SELECT COUNT(*) FROM Highschooler WHERE grade = 9 OR grade = 10


Question:
Show the number of high schoolers for each grade.
Additional table information: table: network_1

Answer: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade


Question:
How many high schoolers are in each grade?
Additional table information: table: network_1

Answer: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade


Question:
Which grade has the most high schoolers?
Additional table information: table: network_1

Answer: 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.
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show me all grades that have at least 4 students.
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4


Question:
Which grades have 4 or more high schoolers?
Additional table information: table: network_1

Answer: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4


Question:
Show the student IDs and numbers of friends corresponding to each.
Additional table information: table: network_1

Answer: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id


Question:
How many friends does each student have?
Additional table information: table: network_1

Answer: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id


Question:
Show the names of high school students and their corresponding number of friends.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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 is the name of the high schooler who has the greatest number of friends?
Additional table information: table: network_1

Answer: 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.
Additional table information: table: network_1

Answer: 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:
Show the names of high schoolers who have at least 3 friends.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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 all of the high schooler Kyle's friends.
Additional table information: table: network_1

Answer: 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.
Additional table information: table: network_1

Answer: 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:
How many friends does the high school student Kyle have?
Additional table information: table: network_1

Answer: 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.
Additional table information: table: network_1

Answer: SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = 'Kyle'


Question:
Show ids of all students who do not have any friends.
Additional table information: table: network_1

Answer: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend


Question:
What are the ids of high school students who do not have friends?
Additional table information: table: network_1

Answer: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend


Question:
Show names of all high school students who do not have any friends.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id


Question:
Show the ids of high schoolers who have friends and are also liked by someone else.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes


Question:
Show name of all students who have some friends and also are liked by someone else.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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:
Count the number of likes for each student id.
Additional table information: table: network_1

Answer: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id


Question:
How many likes correspond to each student id?
Additional table information: table: network_1

Answer: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id


Question:
Show the names of high schoolers who have likes, and numbers of likes for each.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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 is the name of the high schooler who has the greatest number of likes?
Additional table information: table: network_1

Answer: 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.
Additional table information: table: network_1

Answer: 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:
Show the names of students who have at least 2 likes.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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 a grade higher than 5 and have at least 2 friends.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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:
How many likes does Kyle have?
Additional table information: table: network_1

Answer: 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.
Additional table information: table: network_1

Answer: SELECT COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = 'Kyle'


Question:
Find the average grade of all students who have some friends.
Additional table information: table: network_1

Answer: 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?
Additional table information: table: network_1

Answer: 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 minimum grade of students who have no friends.
Additional table information: table: network_1

Answer: 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)


Question:
What is the lowest grade of students who do not have any friends?
Additional table information: table: network_1

Answer: 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)


Question:
Which states have both owners and professionals living there?
Additional table information: table: dog_kennels

Answer: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals


Question:
Find the states where both owners and professionals live.
Additional table information: table: dog_kennels

Answer: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals


Question:
What is the average age of the dogs who have gone through any treatments?
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments)


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.
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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 dogs have not cost their owner more than 1000 for treatment ? List the dog names .
Additional table information: table: dog_kennels

Answer: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000)


Question:
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

Answer: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000)


Question:
Which first names are used for professionals or owners but are not used as dog names?
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs


Question:
Which professional did not operate any treatment on dogs? List the professional's id, role and email.
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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 owner owns the most dogs? List the owner id, first name and last name.
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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 professionals have done at least two treatments? List the professional's id, role, and first name.
Additional table information: table: dog_kennels

Answer: 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?
Additional table information: table: dog_kennels

Answer: 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 is the name of the breed with the most dogs?
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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 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

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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:
What is the description of the treatment type that costs the least money in total?
Additional table information: table: dog_kennels

Answer: 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


Question:
Give me the description of the treatment type whose total cost is the lowest.
Additional table information: table: dog_kennels

Answer: 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


Question:
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

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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 professionals have done at least two types of treatments? List the professional id and cell phone.
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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:
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

Answer: 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)


Question:
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

Answer: 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)


Question:
List the date of each treatment, together with the first name of the professional who operated it.
Additional table information: table: dog_kennels

Answer: 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?
Additional table information: table: dog_kennels

Answer: 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 cost of each treatment and the corresponding treatment type description.
Additional table information: table: dog_kennels

Answer: 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?
Additional table information: table: dog_kennels

Answer: 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 each owner's first name, last name, and the size of his for her dog.
Additional table information: table: dog_kennels

Answer: 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?
Additional table information: table: dog_kennels

Answer: 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 pairs of the owner's first name and the dogs's name.
Additional table information: table: dog_kennels

Answer: 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?
Additional table information: table: dog_kennels

Answer: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id


Question:
List the names of the dogs of the rarest breed and the treatment dates of them.
Additional table information: table: dog_kennels

Answer: 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)


Question:
Which dogs are of the rarest breed? Show their names and treatment dates.
Additional table information: table: dog_kennels

Answer: 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)


Question:
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

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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:
What are the arriving date and the departing date of the dogs who have gone through a treatment?
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: SELECT DISTINCT T1.date_arrived, T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id


Question:
List the last name of the owner owning the youngest dog.
Additional table information: table: dog_kennels

Answer: 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.
Additional table information: table: dog_kennels

Answer: 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 emails of the professionals who live in the state of Hawaii or the state of Wisconsin.
Additional table information: table: dog_kennels

Answer: 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?
Additional table information: table: dog_kennels

Answer: SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'


Question:
What are the arriving date and the departing date of all the dogs?
Additional table information: table: dog_kennels

Answer: SELECT date_arrived, date_departed FROM Dogs


Question:
List the arrival date and the departure date for all the dogs.
Additional table information: table: dog_kennels

Answer: SELECT date_arrived, date_departed FROM Dogs


Question:
How many dogs went through any treatments?
Additional table information: table: dog_kennels

Answer: SELECT COUNT(DISTINCT dog_id) FROM Treatments


Question:
Count the number of dogs that went through a treatment.
Additional table information: table: dog_kennels

Answer: SELECT COUNT(DISTINCT dog_id) FROM Treatments


Question:
How many professionals have performed any treatment to dogs?
Additional table information: table: dog_kennels

Answer: SELECT COUNT(DISTINCT professional_id) FROM Treatments


Question:
Find the number of professionals who have ever treated dogs.
Additional table information: table: dog_kennels

Answer: SELECT COUNT(DISTINCT professional_id) FROM Treatments


Question:
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

Answer: 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'.
Additional table information: table: dog_kennels

Answer: SELECT role_code, street, city, state FROM professionals WHERE city LIKE '%West%'


Question:
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

Answer: SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%'


Question:
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

Answer: SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%'


Question:
How many dogs have an age below the average?
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Dogs WHERE age < (SELECT AVG(age) FROM Dogs)


Question:
Count the number of dogs of an age below the average.
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Dogs WHERE age < (SELECT AVG(age) FROM Dogs)


Question:
How much does the most recent treatment cost?
Additional table information: table: dog_kennels

Answer: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1


Question:
Show me the cost of the most recently performed treatment.
Additional table information: table: dog_kennels

Answer: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1


Question:
How many dogs have not gone through any treatment?
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Dogs WHERE NOT dog_id IN (SELECT dog_id FROM Treatments)


Question:
Tell me the number of dogs that have not received any treatment .
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments)


Question:
How many owners temporarily do not have any dogs?
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs)


Question:
Find the number of owners who do not own any dogs at this moment.
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs)


Question:
How many professionals did not operate any treatment on dogs?
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments)


Question:
Find the number of professionals who have not treated any dogs.
Additional table information: table: dog_kennels

Answer: SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments)


Question:
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

Answer: SELECT name, age, weight FROM Dogs WHERE abandoned_yn = 1


Question:
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

Answer: SELECT name, age, weight FROM Dogs WHERE abandoned_yn = 1


Question:
What is the average age of all the dogs?
Additional table information: table: dog_kennels

Answer: SELECT AVG(age) FROM Dogs


Question:
Compute the average age of all the dogs.
Additional table information: table: dog_kennels

Answer: SELECT AVG(age) FROM Dogs


Question:
What is the age of the oldest dog?
Additional table information: table: dog_kennels

Answer: SELECT MAX(age) FROM Dogs


Question:
Tell me the age of the oldest dog.
Additional table information: table: dog_kennels

Answer: SELECT MAX(age) FROM Dogs


Question:
How much does each charge type costs? List both charge type and amount.
Additional table information: table: dog_kennels

Answer: SELECT charge_type, charge_amount FROM Charges


Question:
List each charge type and its amount.
Additional table information: table: dog_kennels

Answer: SELECT charge_type, charge_amount FROM Charges


Question:
How much does the most expensive charge type costs?
Additional table information: table: dog_kennels

Answer: SELECT MAX(charge_amount) FROM Charges


Question:
What is the charge amount of the most expensive charge type?
Additional table information: table: dog_kennels

Answer: SELECT MAX(charge_amount) FROM Charges


Question:
List the email, cell phone and home phone of all the professionals.
Additional table information: table: dog_kennels

Answer: SELECT email_address, cell_number, home_phone FROM professionals


Question:
What are the email, cell phone and home phone of each professional?
Additional table information: table: dog_kennels

Answer: SELECT email_address, cell_number, home_phone FROM professionals


Question:
What are all the possible breed type and size type combinations?
Additional table information: table: dog_kennels

Answer: SELECT DISTINCT breed_code, size_code FROM dogs


Question:
Find the distinct breed type and size type combinations for dogs.
Additional table information: table: dog_kennels

Answer: SELECT DISTINCT breed_code, size_code FROM dogs


Question:
List the first name of all the professionals along with the description of the treatment they have done.
Additional table information: table: dog_kennels

Answer: 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


Question:
What are each professional's first name and description of the treatment they have performed?
Additional table information: table: dog_kennels

Answer: 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


Question:
How many singers are there?
Additional table information: table: singer

Answer: SELECT COUNT(*) FROM singer


Question:
What is the count of singers?
Additional table information: table: singer

Answer: SELECT COUNT(*) FROM singer


Question:
List the name of singers in ascending order of net worth.
Additional table information: table: singer

Answer: SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC NULLS FIRST


Question:
What are the names of singers ordered by ascending net worth?
Additional table information: table: singer

Answer: SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC NULLS FIRST


Question:
What are the birth year and citizenship of singers?
Additional table information: table: singer

Answer: SELECT Birth_Year, Citizenship FROM singer


Question:
What are the birth years and citizenships of the singers?
Additional table information: table: singer

Answer: SELECT Birth_Year, Citizenship FROM singer


Question:
List the name of singers whose citizenship is not 'France'.
Additional table information: table: singer

Answer: SELECT Name FROM singer WHERE Citizenship <> 'France'


Question:
What are the names of the singers who are not French citizens?
Additional table information: table: singer

Answer: SELECT Name FROM singer WHERE Citizenship <> 'France'


Question:
Show the name of singers whose birth year is either 1948 or 1949?
Additional table information: table: singer

Answer: SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949


Question:
What are the names of the singers whose birth years are either 1948 or 1949?
Additional table information: table: singer

Answer: SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949


Question:
What is the name of the singer with the largest net worth?
Additional table information: table: singer

Answer: SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1


Question:
What is the name of the singer who is worth the most?
Additional table information: table: singer

Answer: SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1


Question:
Show different citizenship of singers and the number of singers of each citizenship.
Additional table information: table: singer

Answer: SELECT Citizenship, COUNT(*) FROM singer GROUP BY Citizenship


Question:
For each citizenship, how many singers are from that country?
Additional table information: table: singer

Answer: SELECT Citizenship, COUNT(*) FROM singer GROUP BY Citizenship


Question:
Please show the most common citizenship of singers.
Additional table information: table: singer

Answer: SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the most common singer citizenship ?
Additional table information: table: singer

Answer: SELECT citizenship FROM singer GROUP BY citizenship ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show different citizenships and the maximum net worth of singers of each citizenship.
Additional table information: table: singer

Answer: SELECT Citizenship, MAX(Net_Worth_Millions) FROM singer GROUP BY Citizenship


Question:
For each citizenship, what is the maximum net worth?
Additional table information: table: singer

Answer: SELECT Citizenship, MAX(Net_Worth_Millions) FROM singer GROUP BY Citizenship


Question:
Show titles of songs and names of singers.
Additional table information: table: singer

Answer: SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID


Question:
What are the song titles and singer names?
Additional table information: table: singer

Answer: SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID


Question:
Show distinct names of singers that have songs with sales more than 300000.
Additional table information: table: singer

Answer: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000


Question:
what are the different names of the singers that have sales more than 300000?
Additional table information: table: singer

Answer: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000


Question:
Show the names of singers that have more than one song.
Additional table information: table: singer

Answer: 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


Question:
What are the names of the singers that have more than one songs?
Additional table information: table: singer

Answer: 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


Question:
Show the names of singers and the total sales of their songs.
Additional table information: table: singer

Answer: 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


Question:
For each singer name, what is the total sales for their songs?
Additional table information: table: singer

Answer: 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


Question:
List the name of singers that do not have any song.
Additional table information: table: singer

Answer: SELECT Name FROM singer WHERE NOT Singer_ID IN (SELECT Singer_ID FROM song)


Question:
What is the sname of every sing that does not have any song?
Additional table information: table: singer

Answer: SELECT Name FROM singer WHERE NOT Singer_ID IN (SELECT Singer_ID FROM song)


Question:
Show the citizenship shared by singers with birth year before 1945 and after 1955.
Additional table information: table: singer

Answer: SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955


Question:
What are the citizenships that are shared by singers with a birth year before 1945 and after 1955?
Additional table information: table: singer

Answer: SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955


Question:
How many available features are there in total?
Additional table information: table: real_estate_properties

Answer: SELECT COUNT(*) FROM Other_Available_Features


Question:
What is the feature type name of feature AirCon?
Additional table information: table: real_estate_properties

Answer: 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'


Question:
Show the property type descriptions of properties belonging to that code.
Additional table information: table: real_estate_properties

Answer: 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


Question:
What are the names of properties that are either houses or apartments with more than 1 room?
Additional table information: table: real_estate_properties

Answer: 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


Question:
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

Answer: SELECT position FROM "canadian_football"."toronto" WHERE school_club_team = 'Butler CC (KS)'


Question:
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

Answer: SELECT COUNT school_club_team FROM "canadian_football"."toronto" WHERE player_number = '3'


Question:
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

Answer: SELECT school_club_team FROM "canadian_football"."toronto" WHERE player_number = '21'


Question:
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

Answer: SELECT player FROM "canadian_football"."toronto" WHERE player_number = '42'


Question:
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

Answer: SELECT player FROM "canadian_football"."toronto" WHERE position = 'Guard' AND years_in_toronto = '1996-97'


Question:
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

Answer: SELECT player FROM "canadian_football"."players" WHERE school_club_team = 'Westchester High School'


Question:
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

Answer: SELECT school_club_team FROM "canadian_football"."players" WHERE player = 'Amir Johnson'


Question:
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

Answer: SELECT COUNT player_number FROM "canadian_football"."players" WHERE years_in_toronto = '2005-06'


Question:
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

Answer: SELECT COUNT Position FROM "canadian_football"."players" WHERE years_in_toronto = '2006-07'


Question:
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

Answer: SELECT nationality FROM "canadian_football"."players" WHERE school_club_team = 'Fresno State'


Question:
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

Answer: SELECT school_club_team FROM "canadian_football"."players" WHERE player = 'Trey Johnson'