Question:
Show the id and star rating of each hotel, ordered by its price from low to high.
Additional table information: table: cre_Theme_park

Answer: SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST


Question:
Find the id and star rating of each hotel and sort them in increasing order of price.
Additional table information: table: cre_Theme_park

Answer: SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST


Question:
Show the details of the top 3 most expensive hotels.
Additional table information: table: cre_Theme_park

Answer: SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3


Question:
What are the details of the three most expensive hotels?
Additional table information: table: cre_Theme_park

Answer: SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3


Question:
Show the details and star ratings of the 3 least expensive hotels.
Additional table information: table: cre_Theme_park

Answer: SELECT other_hotel_details, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST LIMIT 3


Question:
What are the details and star ratings of the three hotels with the lowest price ranges?
Additional table information: table: cre_Theme_park

Answer: SELECT other_hotel_details, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST LIMIT 3


Question:
Show the transportation method most people choose to get to tourist attractions.
Additional table information: table: cre_Theme_park

Answer: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which transportation method is used the most often to get to tourist attractions?
Additional table information: table: cre_Theme_park

Answer: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the description and code of the attraction type most tourist attractions belong to.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Attraction_Type_Description, T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which attraction type does the most tourist attractions belong to? Tell me its  attraction type description and code.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Attraction_Type_Description, T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.
Additional table information: table: cre_Theme_park

Answer: SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There


Question:
List all the possible ways to get to attractions, together with the number of attractions accessible by these methods.
Additional table information: table: cre_Theme_park

Answer: SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There


Question:
Show different tourist attractions' names, ids, and the corresponding number of visits.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID


Question:
What are the name, id and the corresponding number of visits for each  tourist attraction?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID


Question:
Show the names and ids of tourist attractions that are visited at least two times.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2


Question:
Which tourist attractions are visited at least twice? Give me their names and ids.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2


Question:
Show the names and ids of tourist attractions that are visited at most once.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) <= 1


Question:
What are the names and ids of the tourist attractions that are visited at most once?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) <= 1


Question:
What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '660 Shea Crescent' OR T2.How_to_Get_There = 'walk'


Question:
Find the names of the tourist attractions that is either accessible by walk or at address 660 Shea Crescent.
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '660 Shea Crescent' OR T2.How_to_Get_There = 'walk'


Question:
What are the names of the tourist attractions that have parking or shopping as their feature details?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping'


Question:
Find the tourist attractions that have parking or shopping as their feature details. What are the names of the attractions?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping'


Question:
What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '254 Ottilie Junction' OR T2.How_to_Get_There = 'bus'


Question:
Find the names of the tourist attractions that is either accessible by bus or at address 254 Ottilie Junction.
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '254 Ottilie Junction' OR T2.How_to_Get_There = 'bus'


Question:
What are the names of the tourist attractions Vincent and Marcelle visit?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Marcelle'


Question:
Which tourist attractions do the tourists Vincent and Marcelle visit? Tell me the names of the attractions.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Marcelle'


Question:
What are the names of tourist attraction that Alison visited but Rosalind did not visit?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Alison' EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Rosalind'


Question:
Find the the names of the tourist attractions that the tourist named Alison visited but Rosalind did not visit.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Alison' EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Rosalind'


Question:
How many tourists did not make any visit?
Additional table information: table: cre_Theme_park

Answer: SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits)


Question:
Count the number of tourists who did not visit any place.
Additional table information: table: cre_Theme_park

Answer: SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits)


Question:
How many video games exist?
Additional table information: table: game_1

Answer: SELECT COUNT(*) FROM Video_games


Question:
How many video games do you have?
Additional table information: table: game_1

Answer: SELECT COUNT(*) FROM Video_games


Question:
How many video game types exist?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT gtype) FROM Video_games


Question:
What is the count of different game types?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT gtype) FROM Video_games


Question:
Show all video game types.
Additional table information: table: game_1

Answer: SELECT DISTINCT gtype FROM Video_games


Question:
What are the different types of video games?
Additional table information: table: game_1

Answer: SELECT DISTINCT gtype FROM Video_games


Question:
Show all video games and their types in the order of their names.
Additional table information: table: game_1

Answer: SELECT gname, gtype FROM Video_games ORDER BY gname NULLS FIRST


Question:
What are the names of all the video games and their types in alphabetical order?
Additional table information: table: game_1

Answer: SELECT gname, gtype FROM Video_games ORDER BY gname NULLS FIRST


Question:
Show all video games with type Collectible card game.
Additional table information: table: game_1

Answer: SELECT gname FROM Video_games WHERE gtype = 'Collectible card game'


Question:
What are the names of all video games that are collectible cards?
Additional table information: table: game_1

Answer: SELECT gname FROM Video_games WHERE gtype = 'Collectible card game'


Question:
What is the type of video game Call of Destiny.
Additional table information: table: game_1

Answer: SELECT gtype FROM Video_games WHERE gname = 'Call of Destiny'


Question:
What type of game is Call of Destiny?
Additional table information: table: game_1

Answer: SELECT gtype FROM Video_games WHERE gname = 'Call of Destiny'


Question:
How many video games have type Massively multiplayer online game?
Additional table information: table: game_1

Answer: SELECT COUNT(*) FROM Video_games WHERE gtype = 'Massively multiplayer online game'


Question:
Count the number of video games with Massively multiplayer online game type .
Additional table information: table: game_1

Answer: SELECT COUNT(*) FROM Video_games WHERE gtype = 'Massively multiplayer online game'


Question:
Show all video game types and the number of video games in each type.
Additional table information: table: game_1

Answer: SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype


Question:
What are the types of video games and how many are in each type?
Additional table information: table: game_1

Answer: SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype


Question:
Which game type has most number of games?
Additional table information: table: game_1

Answer: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1


Question:
What type has the most games?
Additional table information: table: game_1

Answer: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which game type has least number of games?
Additional table information: table: game_1

Answer: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
What is the type with the fewest games?
Additional table information: table: game_1

Answer: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
Show ids for all students who live in CHI.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE city_code = 'CHI'


Question:
What are the ids of all students who live in CHI?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE city_code = 'CHI'


Question:
Show ids for all students who have advisor 1121.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE Advisor = 1121


Question:
What are the ids of all students who have advisor number 1121?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE Advisor = 1121


Question:
Show first name for all students with major 600.
Additional table information: table: game_1

Answer: SELECT Fname FROM Student WHERE Major = 600


Question:
What are the first names for all students who are from the major numbered 600?
Additional table information: table: game_1

Answer: SELECT Fname FROM Student WHERE Major = 600


Question:
Show the average, minimum, and maximum age for different majors.
Additional table information: table: game_1

Answer: SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major


Question:
What are the average, minimum, and max ages for each of the different majors?
Additional table information: table: game_1

Answer: SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major


Question:
Show all advisors who have at least two students.
Additional table information: table: game_1

Answer: SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2


Question:
What are the advisors
Additional table information: table: game_1

Answer: SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2


Question:
How many sports do we have?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT sportname) FROM Sportsinfo


Question:
How many different types of sports do we offer?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT sportname) FROM Sportsinfo


Question:
How many students play sports?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT StuID) FROM Sportsinfo


Question:
How many different students are involved in sports?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT StuID) FROM Sportsinfo


Question:
List ids for all student who are on scholarship.
Additional table information: table: game_1

Answer: SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'


Question:
What are the ids for all sporty students who are on scholarship?
Additional table information: table: game_1

Answer: SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'


Question:
Show last names for all student who are on scholarship.
Additional table information: table: game_1

Answer: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'


Question:
What are the last names for all scholarship students?
Additional table information: table: game_1

Answer: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'


Question:
How many games are played for all students?
Additional table information: table: game_1

Answer: SELECT SUM(gamesplayed) FROM Sportsinfo


Question:
What is the total number of games played?
Additional table information: table: game_1

Answer: SELECT SUM(gamesplayed) FROM Sportsinfo


Question:
How many games are played for all football games by students on scholarship?
Additional table information: table: game_1

Answer: SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = 'Football' AND onscholarship = 'Y'


Question:
What is the total number of all football games played by scholarship students?
Additional table information: table: game_1

Answer: SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = 'Football' AND onscholarship = 'Y'


Question:
Show all sport name and the number of students.
Additional table information: table: game_1

Answer: SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname


Question:
How many students play each sport?
Additional table information: table: game_1

Answer: SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname


Question:
Show all student IDs with the number of sports and total number of games played
Additional table information: table: game_1

Answer: SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID


Question:
What are the ids of all students along with how many sports and games did they play?
Additional table information: table: game_1

Answer: SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID


Question:
Show all student IDs with more than total 10 hours per week on all sports played.
Additional table information: table: game_1

Answer: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10


Question:
What are the student IDs for everybody who worked for more than 10 hours per week on all sports?
Additional table information: table: game_1

Answer: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10


Question:
What is the first name and last name of the student who have most number of sports?
Additional table information: table: game_1

Answer: SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the first and last name of the student who played the most sports?
Additional table information: table: game_1

Answer: SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which sport has most number of students on scholarship?
Additional table information: table: game_1

Answer: SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the sport with the most scholarship students?
Additional table information: table: game_1

Answer: SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show student ids who don't have any sports.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo


Question:
What are the ids of all students who don't play sports?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo


Question:
Show student ids who are on scholarship and have major 600.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'


Question:
What are the student ids for those on scholarship in major number 600?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'


Question:
Show student ids who are female and play football.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'


Question:
What are the ids of all female students who play football?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'


Question:
Show all male student ids who don't play football.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'


Question:
What are the ids of all male students who do not play football?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'


Question:
Show total hours per week and number of games played for student David Shieber.
Additional table information: table: game_1

Answer: SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = 'David' AND T2.Lname = 'Shieber'


Question:
What is the total number of hours per work and number of games played by David Shieber?
Additional table information: table: game_1

Answer: SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = 'David' AND T2.Lname = 'Shieber'


Question:
Show total hours per week and number of games played for students under 20.
Additional table information: table: game_1

Answer: SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20


Question:
What is the total number of hours per week and number of games played by students under 20?
Additional table information: table: game_1

Answer: SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20


Question:
How many students play video games?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT StuID) FROM Plays_games


Question:
How many different students play games?
Additional table information: table: game_1

Answer: SELECT COUNT(DISTINCT StuID) FROM Plays_games


Question:
Show ids of students who don't play video game.
Additional table information: table: game_1

Answer: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games


Question:
What are the ids of all students who are not video game players?
Additional table information: table: game_1

Answer: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games


Question:
Show ids of students who play video game and play sports.
Additional table information: table: game_1

Answer: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games


Question:
What are the ids of all students who played video games and sports?
Additional table information: table: game_1

Answer: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games


Question:
Show all game ids and the number of hours played.
Additional table information: table: game_1

Answer: SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid


Question:
What are ids and total number of hours played for each game?
Additional table information: table: game_1

Answer: SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid


Question:
Show all student ids and the number of hours played.
Additional table information: table: game_1

Answer: SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid


Question:
What are the ids of all students and number of hours played?
Additional table information: table: game_1

Answer: SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid


Question:
Show the game name that has most number of hours played.
Additional table information: table: game_1

Answer: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1


Question:
What is the name of the game that has been played the most?
Additional table information: table: game_1

Answer: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1


Question:
Show all game names played by at least 1000 hours.
Additional table information: table: game_1

Answer: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000


Question:
What are the names of all the games that have been played for at least 1000 hours?
Additional table information: table: game_1

Answer: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000


Question:
Show all game names played by Linda Smith
Additional table information: table: game_1

Answer: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = 'Smith' AND T3.Fname = 'Linda'


Question:
What are the names of all games played by Linda Smith?
Additional table information: table: game_1

Answer: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = 'Smith' AND T3.Fname = 'Linda'


Question:
Find the last and first name of students who are playing Football or Lacrosse.
Additional table information: table: game_1

Answer: SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = 'Football' OR T1.SportName = 'Lacrosse'


Question:
What is the first and last name of all students who play Football or Lacrosse?
Additional table information: table: game_1

Answer: SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = 'Football' OR T1.SportName = 'Lacrosse'


Question:
Find the first name and age of the students who are playing both Football and Lacrosse.
Additional table information: table: game_1

Answer: SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = 'Football' INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = 'Lacrosse')


Question:
What are the first names and ages of all students who are playing both Football and Lacrosse?
Additional table information: table: game_1

Answer: SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = 'Football' INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = 'Lacrosse')


Question:
Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.
Additional table information: table: game_1

Answer: SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Call of Destiny' INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Works of Widenius')


Question:
what is the last name and gender of all students who played both Call of Destiny and Works of Widenius?
Additional table information: table: game_1

Answer: SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Call of Destiny' INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Works of Widenius')


Question:
Find the name of all customers.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers


Question:
What are the names of all the customers?
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers


Question:
How many customers are there?
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(*) FROM customers


Question:
Return the total number of distinct customers.
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(*) FROM customers


Question:
What is the average amount of items ordered in each order?
Additional table information: table: customers_and_addresses

Answer: SELECT AVG(order_quantity) FROM order_items


Question:
Find the average order quantity per order.
Additional table information: table: customers_and_addresses

Answer: SELECT AVG(order_quantity) FROM order_items


Question:
What are the names of customers who use payment method 'Cash'?
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE payment_method = 'Cash'


Question:
Which customers use 'Cash' for payment method? Return the customer names.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE payment_method = 'Cash'


Question:
Find the 'date became customers' of the customers whose ID is between 10 and 20.
Additional table information: table: customers_and_addresses

Answer: SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20


Question:
What are the dates when customers with ids between 10 and 20 became customers?
Additional table information: table: customers_and_addresses

Answer: SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20


Question:
Which payment method is used by most customers?
Additional table information: table: customers_and_addresses

Answer: SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the payment method that is used most frequently.
Additional table information: table: customers_and_addresses

Answer: SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the names of customers using the most popular payment method?
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1)


Question:
Find the name of the customers who use the most frequently used payment method.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1)


Question:
What are all the payment methods?
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT payment_method FROM customers


Question:
Return all the distinct payment methods used by customers.
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT payment_method FROM customers


Question:
What are the details of all products?
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT product_details FROM products


Question:
Return the the details of all products.
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT product_details FROM products


Question:
Find the name of all customers whose name contains 'Alex'.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE customer_name LIKE '%Alex%'


Question:
Which customer's name contains 'Alex'? Find the full name.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE customer_name LIKE '%Alex%'


Question:
Find the detail of products whose detail contains the word 'Latte' or the word 'Americano'
Additional table information: table: customers_and_addresses

Answer: SELECT product_details FROM products WHERE product_details LIKE '%Latte%' OR product_details LIKE '%Americano%'


Question:
Which product's detail contains the word 'Latte' or 'Americano'? Return the full detail.
Additional table information: table: customers_and_addresses

Answer: SELECT product_details FROM products WHERE product_details LIKE '%Latte%' OR product_details LIKE '%Americano%'


Question:
What is the address content of the customer named 'Maudie Kertzmann'?
Additional table information: table: customers_and_addresses

Answer: SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = 'Maudie Kertzmann'


Question:
Return the address content for the customer whose name is 'Maudie Kertzmann'.
Additional table information: table: customers_and_addresses

Answer: SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = 'Maudie Kertzmann'


Question:
How many customers are living in city 'Lake Geovannyton'?
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = 'Lake Geovannyton'


Question:
Find the number of customers who live in the city called Lake Geovannyton.
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = 'Lake Geovannyton'


Question:
Find the name of customers who are living in Colorado?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'Colorado'


Question:
What are the names of customers who live in Colorado state?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'Colorado'


Question:
Find the list of cities that no customer is living in.
Additional table information: table: customers_and_addresses

Answer: SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)


Question:
What are the cities no customers live in?
Additional table information: table: customers_and_addresses

Answer: SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)


Question:
Which city has the most customers living in?
Additional table information: table: customers_and_addresses

Answer: SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the city where the most customers live.
Additional table information: table: customers_and_addresses

Answer: SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1


Question:
Retrieve the list of all cities.
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT city FROM addresses


Question:
List all the distinct cities
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT city FROM addresses


Question:
Find the city with post code 255.
Additional table information: table: customers_and_addresses

Answer: SELECT city FROM addresses WHERE zip_postcode = 255


Question:
Which city is post code 255 located in?
Additional table information: table: customers_and_addresses

Answer: SELECT city FROM addresses WHERE zip_postcode = 255


Question:
Find the state and country of all cities with post code starting with 4.
Additional table information: table: customers_and_addresses

Answer: SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE '4%'


Question:
What are the state and country of all the cities that have post codes starting with 4.\
Additional table information: table: customers_and_addresses

Answer: SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE '4%'


Question:
List the countries having more than 4 addresses listed.
Additional table information: table: customers_and_addresses

Answer: SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4


Question:
For which countries are there more than four distinct addresses listed?
Additional table information: table: customers_and_addresses

Answer: SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4


Question:
List all the contact channel codes that were used less than 5 times.
Additional table information: table: customers_and_addresses

Answer: SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5


Question:
Which contact channel codes were used less than 5 times?
Additional table information: table: customers_and_addresses

Answer: SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5


Question:
Which contact channel has been used by the customer with name 'Tillman Ernser'?
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'


Question:
Find the contact channel code that was used by the customer named 'Tillman Ernser'.
Additional table information: table: customers_and_addresses

Answer: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'


Question:
What is the 'active to date' of the latest contact channel used by 'Tillman Ernser'?
Additional table information: table: customers_and_addresses

Answer: SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'


Question:
Return the the 'active to date' of the latest contact channel used by the customer named 'Tillman Ernser'.
Additional table information: table: customers_and_addresses

Answer: SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'


Question:
What is the average time span of contact channels in the database?
Additional table information: table: customers_and_addresses

Answer: SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels


Question:
Compute the average active time span of contact channels.
Additional table information: table: customers_and_addresses

Answer: SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels


Question:
What is the channel code and contact number of the customer contact channel that was active for the longest time?
Additional table information: table: customers_and_addresses

Answer: SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)


Question:
Return the channel code and contact number of the customer contact channel whose active duration was the longest.
Additional table information: table: customers_and_addresses

Answer: SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)


Question:
Find the name and active date of the customer that use email as the contact channel.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'


Question:
What are the name and active date of the customers whose contact channel code is email?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'


Question:
What is the name of the customer that made the order with the largest quantity?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)


Question:
Find the name of the customer who made the order of the largest amount of goods.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)


Question:
What is the name of the customer that has purchased the most items?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1


Question:
Give me the name of the customer who ordered the most items in total.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1


Question:
What is the payment method of the customer that has purchased the least quantity of items?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) NULLS FIRST LIMIT 1


Question:
Tell me the payment method used by the customer who ordered the least amount of goods in total.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) NULLS FIRST LIMIT 1


Question:
How many types of products have Rodrick Heaney bought in total?
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'


Question:
Find the number of distinct products Rodrick Heaney has bought so far.
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'


Question:
What is the total quantity of products purchased by 'Rodrick Heaney'?
Additional table information: table: customers_and_addresses

Answer: SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'


Question:
Tell me the total quantity of products bought by the customer called 'Rodrick Heaney'.
Additional table information: table: customers_and_addresses

Answer: SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'


Question:
How many customers have at least one order with status 'Cancelled'?
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = 'Cancelled'


Question:
Return the number of customers who have at least one order with 'Cancelled' status.
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = 'Cancelled'


Question:
How many orders have detail 'Second time'?
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(*) FROM customer_orders WHERE order_details = 'Second time'


Question:
Tell me the number of orders with 'Second time' as order detail.
Additional table information: table: customers_and_addresses

Answer: SELECT COUNT(*) FROM customer_orders WHERE order_details = 'Second time'


Question:
Find the customer name and date of the orders that have the status 'Delivered'.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = 'Delivered'


Question:
What are the customer name and date of the orders whose status is 'Delivered'.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = 'Delivered'


Question:
What is the total number of products that are in orders with status 'Cancelled'?
Additional table information: table: customers_and_addresses

Answer: SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = 'Cancelled'


Question:
Find the total quantity of products associated with the orders in the 'Cancelled' status.
Additional table information: table: customers_and_addresses

Answer: SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = 'Cancelled'


Question:
Find the total amount of products ordered before 2018-03-17 07:13:53.
Additional table information: table: customers_and_addresses

Answer: SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < '2018-03-17 07:13:53'


Question:
What is the total amount of products purchased before 2018-03-17 07:13:53?
Additional table information: table: customers_and_addresses

Answer: SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < '2018-03-17 07:13:53'


Question:
Who made the latest order?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1


Question:
Find the name of the customer who made an order most recently.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1


Question:
Which product has been ordered most number of times?
Additional table information: table: customers_and_addresses

Answer: SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the most frequently ordered product? Tell me the detail of the product
Additional table information: table: customers_and_addresses

Answer: SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name and ID of the product whose total order quantity is the largest.
Additional table information: table: customers_and_addresses

Answer: SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) NULLS FIRST LIMIT 1


Question:
What are the name and ID of the product bought the most.
Additional table information: table: customers_and_addresses

Answer: SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) NULLS FIRST LIMIT 1


Question:
Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
Additional table information: table: customers_and_addresses

Answer: SELECT address_content FROM addresses WHERE city = 'East Julianaside' AND state_province_county = 'Texas' UNION SELECT address_content FROM addresses WHERE city = 'Gleasonmouth' AND state_province_county = 'Arizona'


Question:
What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
Additional table information: table: customers_and_addresses

Answer: SELECT address_content FROM addresses WHERE city = 'East Julianaside' AND state_province_county = 'Texas' UNION SELECT address_content FROM addresses WHERE city = 'Gleasonmouth' AND state_province_county = 'Arizona'


Question:
Find the name of customers who did not pay with Cash.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE payment_method <> 'Cash'


Question:
What is the name of customers who do not use Cash as payment method.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers WHERE payment_method <> 'Cash'


Question:
Find the names of customers who never ordered product Latte.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'


Question:
What are names of customers who never ordered product Latte.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'


Question:
Find the names of customers who never placed an order.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id


Question:
What are the names of customers who never made an order.
Additional table information: table: customers_and_addresses

Answer: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id


Question:
Find the names of customers who ordered both products Latte and Americano.
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano'


Question:
What are the names of customers who have purchased both products Latte and Americano?
Additional table information: table: customers_and_addresses

Answer: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano'


Question:
How many artists are there?
Additional table information: table: music_4

Answer: SELECT COUNT(*) FROM artist


Question:
Count the number of artists.
Additional table information: table: music_4

Answer: SELECT COUNT(*) FROM artist


Question:
List the age of all music artists.
Additional table information: table: music_4

Answer: SELECT Age FROM artist


Question:
What are the ages of all music artists?
Additional table information: table: music_4

Answer: SELECT Age FROM artist


Question:
What is the average age of all artists?
Additional table information: table: music_4

Answer: SELECT AVG(Age) FROM artist


Question:
Return the average age across all artists.
Additional table information: table: music_4

Answer: SELECT AVG(Age) FROM artist


Question:
What are the famous titles of the artist 'Triumfall'?
Additional table information: table: music_4

Answer: SELECT Famous_Title FROM artist WHERE Artist = 'Triumfall'


Question:
Return the famous titles of the artist called 'Triumfall'.
Additional table information: table: music_4

Answer: SELECT Famous_Title FROM artist WHERE Artist = 'Triumfall'


Question:
What are the distinct Famous release dates?
Additional table information: table: music_4

Answer: SELECT DISTINCT (Famous_Release_date) FROM artist


Question:
Give the distinct famous release dates for all artists.
Additional table information: table: music_4

Answer: SELECT DISTINCT (Famous_Release_date) FROM artist


Question:
Return the dates of ceremony and the results of all music festivals
Additional table information: table: music_4

Answer: SELECT Date_of_ceremony, RESULT FROM music_festival


Question:
What are the dates of ceremony and results for each music festival?
Additional table information: table: music_4

Answer: SELECT Date_of_ceremony, RESULT FROM music_festival


Question:
What are the category of music festivals with result 'Awarded'?
Additional table information: table: music_4

Answer: SELECT Category FROM music_festival WHERE RESULT = 'Awarded'


Question:
Return the categories of music festivals that have the result 'Awarded'.
Additional table information: table: music_4

Answer: SELECT Category FROM music_festival WHERE RESULT = 'Awarded'


Question:
What are the maximum and minimum week on top of all volumes?
Additional table information: table: music_4

Answer: SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume


Question:
Give the maximum and minimum weeks on top across all volumes.
Additional table information: table: music_4

Answer: SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume


Question:
What are the songs in volumes with more than 1 week on top?
Additional table information: table: music_4

Answer: SELECT Song FROM volume WHERE Weeks_on_Top > 1


Question:
Give the songs included in volumes that have more than 1 week on top.
Additional table information: table: music_4

Answer: SELECT Song FROM volume WHERE Weeks_on_Top > 1


Question:
Please list all songs in volumes in ascending alphabetical order.
Additional table information: table: music_4

Answer: SELECT Song FROM volume ORDER BY Song NULLS FIRST


Question:
What are the the songs in volumes, listed in ascending order?
Additional table information: table: music_4

Answer: SELECT Song FROM volume ORDER BY Song NULLS FIRST


Question:
How many distinct artists do the volumes associate to?
Additional table information: table: music_4

Answer: SELECT COUNT(DISTINCT Artist_ID) FROM volume


Question:
Count the number of distinct artists who have volumes.
Additional table information: table: music_4

Answer: SELECT COUNT(DISTINCT Artist_ID) FROM volume


Question:
Please show the date of ceremony of the volumes that last more than 2 weeks on top.
Additional table information: table: music_4

Answer: SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2


Question:
What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?
Additional table information: table: music_4

Answer: SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2


Question:
Please show the songs that have result 'nominated' at music festivals.
Additional table information: table: music_4

Answer: SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = 'Nominated'


Question:
What are the songs in volumes that have resulted in a nomination at music festivals?
Additional table information: table: music_4

Answer: SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = 'Nominated'


Question:
What are the issue dates of volumes associated with the artist 'Gorgoroth'?
Additional table information: table: music_4

Answer: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = 'Gorgoroth'


Question:
Return the issue dates of volumes that are by the artist named Gorgoroth.
Additional table information: table: music_4

Answer: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = 'Gorgoroth'


Question:
What are the songs in volumes associated with the artist aged 32 or older?
Additional table information: table: music_4

Answer: SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32


Question:
Return names of songs in volumes that are by artists that are at least 32 years old.
Additional table information: table: music_4

Answer: SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32


Question:
What is the average weeks on top of volumes associated with the artist aged 25 or younger?
Additional table information: table: music_4

Answer: SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25


Question:
Return the average number of weeks on top for volumes by artists that are at most 25 years old.
Additional table information: table: music_4

Answer: SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25


Question:
What are the famous title of the artists associated with volumes with more than 2 weeks on top?
Additional table information: table: music_4

Answer: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2


Question:
Return the famous titles for artists that have volumes that lasted more than 2 weeks on top.
Additional table information: table: music_4

Answer: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2


Question:
Please list the age and famous title of artists in descending order of age.
Additional table information: table: music_4

Answer: SELECT Famous_Title, Age FROM artist ORDER BY Age DESC


Question:
What are the famous titles and ages of each artist, listed in descending order by age?
Additional table information: table: music_4

Answer: SELECT Famous_Title, Age FROM artist ORDER BY Age DESC


Question:
What is the famous release date of the artist with the oldest age?
Additional table information: table: music_4

Answer: SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1


Question:
Return the famous release date for the oldest artist.
Additional table information: table: music_4

Answer: SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1


Question:
Please show the categories of the music festivals and the count.
Additional table information: table: music_4

Answer: SELECT Category, COUNT(*) FROM music_festival GROUP BY Category


Question:
Return the number of music festivals of each category.
Additional table information: table: music_4

Answer: SELECT Category, COUNT(*) FROM music_festival GROUP BY Category


Question:
What is the most common result of the music festival?
Additional table information: table: music_4

Answer: SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the result that is most frequent at music festivals.
Additional table information: table: music_4

Answer: SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1


Question:
Please show the categories of the music festivals with count more than 1.
Additional table information: table: music_4

Answer: SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1


Question:
What are the categories of music festivals for which there have been more than 1 music festival?
Additional table information: table: music_4

Answer: SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1


Question:
What is the song in the volume with the maximum weeks on top?
Additional table information: table: music_4

Answer: SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1


Question:
Return the song in the volume that has spent the most weeks on top?
Additional table information: table: music_4

Answer: SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1


Question:
Find the famous titles of artists that do not have any volume.
Additional table information: table: music_4

Answer: SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume)


Question:
What are the famous titles of artists who do not have any volumes?
Additional table information: table: music_4

Answer: SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume)


Question:
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
Additional table information: table: music_4

Answer: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2


Question:
What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?
Additional table information: table: music_4

Answer: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2


Question:
What are the date of ceremony of music festivals with category 'Best Song' and result 'Awarded'?
Additional table information: table: music_4

Answer: SELECT Date_of_ceremony FROM music_festival WHERE Category = 'Best Song' AND RESULT = 'Awarded'


Question:
Return the dates of ceremony corresponding to music festivals that had the category 'Best Song' and result 'Awarded'.
Additional table information: table: music_4

Answer: SELECT Date_of_ceremony FROM music_festival WHERE Category = 'Best Song' AND RESULT = 'Awarded'


Question:
What is the issue date of the volume with the minimum weeks on top?
Additional table information: table: music_4

Answer: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC NULLS FIRST LIMIT 1


Question:
Return the issue date of the volume that has spent the fewest weeks on top.
Additional table information: table: music_4

Answer: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC NULLS FIRST LIMIT 1


Question:
How many distinct artists have volumes?
Additional table information: table: music_4

Answer: SELECT COUNT(DISTINCT Artist_ID) FROM volume


Question:
Count the number of artists who have had volumes.
Additional table information: table: music_4

Answer: SELECT COUNT(DISTINCT Artist_ID) FROM volume


Question:
Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.
Additional table information: table: music_4

Answer: SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC


Question:
How many music festivals have had each kind of result, ordered descending by count?
Additional table information: table: music_4

Answer: SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC


Question:
What are the issue dates of volumes associated with the artist aged 23 or younger?
Additional table information: table: music_4

Answer: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23


Question:
Return the issue dates of volumes by artists who are at most 23 years old?
Additional table information: table: music_4

Answer: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23


Question:
How many roller coasters are there?
Additional table information: table: roller_coaster

Answer: SELECT COUNT(*) FROM roller_coaster


Question:
List the names of roller coasters by ascending order of length.
Additional table information: table: roller_coaster

Answer: SELECT Name FROM roller_coaster ORDER BY LENGTH ASC NULLS FIRST


Question:
What are the lengths and heights of roller coasters?
Additional table information: table: roller_coaster

Answer: SELECT LENGTH, Height FROM roller_coaster


Question:
List the names of countries whose language is not 'German'.
Additional table information: table: roller_coaster

Answer: SELECT Name FROM country WHERE Languages <> 'German'


Question:
Show the statuses of roller coasters longer than 3300 or higher than 100.
Additional table information: table: roller_coaster

Answer: SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100


Question:
What are the speeds of the longest roller coaster?
Additional table information: table: roller_coaster

Answer: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1


Question:
What is the average speed of roller coasters?
Additional table information: table: roller_coaster

Answer: SELECT AVG(Speed) FROM roller_coaster


Question:
Show the different statuses and the numbers of roller coasters for each status.
Additional table information: table: roller_coaster

Answer: SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status


Question:
Please show the most common status of roller coasters.
Additional table information: table: roller_coaster

Answer: SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the status shared by more than two roller coaster.
Additional table information: table: roller_coaster

Answer: SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2


Question:
Show the park of the roller coaster with the highest speed.
Additional table information: table: roller_coaster

Answer: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1


Question:
Show the names of roller coasters and names of country they are in.
Additional table information: table: roller_coaster

Answer: SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID


Question:
Show the names of countries that have more than one roller coaster.
Additional table information: table: roller_coaster

Answer: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1


Question:
Show the name and population of the country that has the highest roller coaster.
Additional table information: table: roller_coaster

Answer: SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1


Question:
Show the names of countries and the average speed of roller coasters from each country.
Additional table information: table: roller_coaster

Answer: SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name


Question:
How many countries do not have an roller coaster longer than 3000?
Additional table information: table: roller_coaster

Answer: SELECT COUNT(*) FROM country WHERE NOT country_id IN (SELECT country_id FROM roller_coaster WHERE LENGTH > 3000)


Question:
What are the country names, area and population which has both roller coasters with speed higher
Additional table information: table: roller_coaster

Answer: SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55


Question:
How many different captain ranks are there?
Additional table information: table: ship_1

Answer: SELECT COUNT(DISTINCT rank) FROM captain


Question:
Count the number of different ranks of captain.
Additional table information: table: ship_1

Answer: SELECT COUNT(DISTINCT rank) FROM captain


Question:
How many captains are in each rank?
Additional table information: table: ship_1

Answer: SELECT COUNT(*), rank FROM captain GROUP BY rank


Question:
Count the number of captains that have each rank.
Additional table information: table: ship_1

Answer: SELECT COUNT(*), rank FROM captain GROUP BY rank


Question:
How many captains with younger than 50 are in each rank?
Additional table information: table: ship_1

Answer: SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank


Question:
Count the number of captains younger than 50 of each rank.
Additional table information: table: ship_1

Answer: SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank


Question:
Sort all captain names by their ages from old to young.
Additional table information: table: ship_1

Answer: SELECT name FROM captain ORDER BY age DESC


Question:
What are the names of captains, sorted by age descending?
Additional table information: table: ship_1

Answer: SELECT name FROM captain ORDER BY age DESC


Question:
Find the name, class and rank of all captains.
Additional table information: table: ship_1

Answer: SELECT name, CLASS, rank FROM captain


Question:
What are the names, classes, and ranks of all captains?
Additional table information: table: ship_1

Answer: SELECT name, CLASS, rank FROM captain


Question:
Which rank is the most common among captains?
Additional table information: table: ship_1

Answer: SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the rank for which there are the fewest captains.
Additional table information: table: ship_1

Answer: SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which classes have more than two captains?
Additional table information: table: ship_1

Answer: SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2


Question:
Give the classes that have more than two captains.
Additional table information: table: ship_1

Answer: SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2


Question:
Find the name of captains whose rank are either Midshipman or Lieutenant.
Additional table information: table: ship_1

Answer: SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'


Question:
What are the names of captains that have either the rank Midshipman or Lieutenant?
Additional table information: table: ship_1

Answer: SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'


Question:
What are the average and minimum age of captains in different class?
Additional table information: table: ship_1

Answer: SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS


Question:
Return the average and minimum age of captains in each class.
Additional table information: table: ship_1

Answer: SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS


Question:
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
Additional table information: table: ship_1

Answer: SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'


Question:
What are the ranks of captains that are both in the Cutter and Armed schooner classes?
Additional table information: table: ship_1

Answer: SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'


Question:
Find the captain rank that has no captain in Third-rate ship of the line class.
Additional table information: table: ship_1

Answer: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'


Question:
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
Additional table information: table: ship_1

Answer: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'


Question:
What is the name of the youngest captain?
Additional table information: table: ship_1

Answer: SELECT name FROM captain ORDER BY age NULLS FIRST LIMIT 1


Question:
Return the name of the youngest captain.
Additional table information: table: ship_1

Answer: SELECT name FROM captain ORDER BY age NULLS FIRST LIMIT 1


Question:
how many ships are there?
Additional table information: table: ship_1

Answer: SELECT COUNT(*) FROM ship


Question:
Count the number of ships.
Additional table information: table: ship_1

Answer: SELECT COUNT(*) FROM ship


Question:
Find the name, type, and flag of the ship that is built in the most recent year.
Additional table information: table: ship_1

Answer: SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1


Question:
What is the name, type, and flag of the ship that was built in the most recent year?
Additional table information: table: ship_1

Answer: SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1


Question:
Group by ships by flag, and return number of ships that have each flag.
Additional table information: table: ship_1

Answer: SELECT COUNT(*), flag FROM ship GROUP BY flag


Question:
What are the different ship flags, and how many ships have each?
Additional table information: table: ship_1

Answer: SELECT COUNT(*), flag FROM ship GROUP BY flag


Question:
Which flag is most widely used among all ships?
Additional table information: table: ship_1

Answer: SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the flag that is most common among all ships.
Additional table information: table: ship_1

Answer: SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1


Question:
List all ship names in the order of built year and class.
Additional table information: table: ship_1

Answer: SELECT name FROM ship ORDER BY built_year NULLS FIRST, CLASS NULLS FIRST


Question:
What are the names of ships, ordered by year they were built and their class?
Additional table information: table: ship_1

Answer: SELECT name FROM ship ORDER BY built_year NULLS FIRST, CLASS NULLS FIRST


Question:
Find the ship type that are used by both ships with Panama and Malta flags.
Additional table information: table: ship_1

Answer: SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'


Question:
What types of ships have both ships that have Panama Flags and Malta flags?
Additional table information: table: ship_1

Answer: SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'


Question:
In which year were most of ships built?
Additional table information: table: ship_1

Answer: SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the year in which most ships were built?
Additional table information: table: ship_1

Answer: SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name of the ships that have more than one captain.
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1


Question:
What are the names of ships that have more than one captain?
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1


Question:
what are the names and classes of the ships that do not have any captain yet?
Additional table information: table: ship_1

Answer: SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)


Question:
Return the names and classes of ships that do not have a captain?
Additional table information: table: ship_1

Answer: SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)


Question:
Find the name of the ship that is steered by the youngest captain.
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age NULLS FIRST LIMIT 1


Question:
What is the name of the ship that is commanded by the youngest captain?
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age NULLS FIRST LIMIT 1


Question:
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
Additional table information: table: ship_1

Answer: SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')


Question:
What are the names and flags of ships that do not have a captain with the rank of Midshipman?
Additional table information: table: ship_1

Answer: SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')


Question:
Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'


Question:
What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?
Additional table information: table: ship_1

Answer: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'


Question:
What is id of the city that hosted events in the most recent year?
Additional table information: table: city_record

Answer: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1


Question:
Find the city that hosted some events in the most recent year. What is the id of this city?
Additional table information: table: city_record

Answer: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1


Question:
Find the match ids of the cities that hosted competition '1994 FIFA World Cup qualification'?
Additional table information: table: city_record

Answer: SELECT match_id FROM MATCH WHERE competition = '1994 FIFA World Cup qualification'


Question:
What is the match id of the competition called '1994 FIFA World Cup qualification'?
Additional table information: table: city_record

Answer: SELECT match_id FROM MATCH WHERE competition = '1994 FIFA World Cup qualification'


Question:
Find the cities which were once a host city after 2010?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010


Question:
Which cities served as a host city after 2010?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010


Question:
Which city has hosted the most events?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the city that hosted the most events.
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the venue of the competition '1994 FIFA World Cup qualification' hosted by 'Nanjing ( Jiangsu )'?
Additional table information: table: city_record

Answer: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = 'Nanjing ( Jiangsu )' AND T3.competition = '1994 FIFA World Cup qualification'


Question:
Find the venue of the competition '1994 FIFA World Cup qualification' which was hosted by 'Nanjing ( Jiangsu )'.
Additional table information: table: city_record

Answer: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = 'Nanjing ( Jiangsu )' AND T3.competition = '1994 FIFA World Cup qualification'


Question:
Give me the temperature of Shanghai in January.
Additional table information: table: city_record

Answer: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = 'Shanghai'


Question:
What is the temperature of 'Shanghai' city in January?
Additional table information: table: city_record

Answer: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = 'Shanghai'


Question:
What is the host year of city 'Taizhou ( Zhejiang )'?
Additional table information: table: city_record

Answer: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = 'Taizhou ( Zhejiang )'


Question:
IN which year did city 'Taizhou ( Zhejiang )' serve as a host city?
Additional table information: table: city_record

Answer: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = 'Taizhou ( Zhejiang )'


Question:
Which three cities have the largest regional population?
Additional table information: table: city_record

Answer: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3


Question:
What are the three largest cities in terms of regional population?
Additional table information: table: city_record

Answer: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3


Question:
Which city has the lowest GDP? Please list the city name and its GDP.
Additional table information: table: city_record

Answer: SELECT city, GDP FROM city ORDER BY GDP NULLS FIRST LIMIT 1


Question:
What is the city with the smallest GDP? Return the city and its GDP.
Additional table information: table: city_record

Answer: SELECT city, GDP FROM city ORDER BY GDP NULLS FIRST LIMIT 1


Question:
Which city has the highest temperature in February?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1


Question:
In February, which city marks the highest temperature?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1


Question:
Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct


Question:
Which cities' temperature in March is lower than that in July or higher than that in Oct?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct


Question:
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
Which cities have lower temperature in March than in July and have been once host cities?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
Which cities have lower temperature in March than in Dec and have never served as host cities?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
Which cities have higher temperature in Feb than in Jun or have once served as host cities?
Additional table information: table: city_record

Answer: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city


Question:
Please give me a list of cities whose regional population is over 10000000.
Additional table information: table: city_record

Answer: SELECT city FROM city WHERE regional_population > 10000000


Question:
Which cities have regional population above 10000000?
Additional table information: table: city_record

Answer: SELECT city FROM city WHERE regional_population > 10000000


Question:
Please give me a list of cities whose regional population is over 8000000 or under 5000000.
Additional table information: table: city_record

Answer: SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000


Question:
Which cities have regional population above 8000000 or below 5000000?
Additional table information: table: city_record

Answer: SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000


Question:
Find the number of matches in different competitions.
Additional table information: table: city_record

Answer: SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition


Question:
For each competition, count the number of matches.
Additional table information: table: city_record

Answer: SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition


Question:
List venues of all matches in the order of their dates starting from the most recent one.
Additional table information: table: city_record

Answer: SELECT venue FROM MATCH ORDER BY date DESC


Question:
What are the venues of all the matches? Sort them in the descending order of match date.
Additional table information: table: city_record

Answer: SELECT venue FROM MATCH ORDER BY date DESC


Question:
what is the GDP of the city with the largest population.
Additional table information: table: city_record

Answer: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1


Question:
Find the GDP of the city with the largest regional population.
Additional table information: table: city_record

Answer: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1


Question:
What are the GDP and population of the city that already served as a host more than once?
Additional table information: table: city_record

Answer: SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1


Question:
Which cities have served as host cities more than once? Return me their GDP and population.
Additional table information: table: city_record

Answer: SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1


Question:
List every individual's first name, middle name and last name in alphabetical order by last name.
Additional table information: table: e_government

Answer: SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name NULLS FIRST


Question:
What are the first, middle, and last names of all individuals, ordered by last name?
Additional table information: table: e_government

Answer: SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name NULLS FIRST


Question:
List all the types of forms.
Additional table information: table: e_government

Answer: SELECT DISTINCT form_type_code FROM forms


Question:
What are the different types of forms?
Additional table information: table: e_government

Answer: SELECT DISTINCT form_type_code FROM forms


Question:
Find the name of the most popular party form.
Additional table information: table: e_government

Answer: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of the party form that is most common?
Additional table information: table: e_government

Answer: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the payment method and phone of the party with email 'enrico09@example.com'.
Additional table information: table: e_government

Answer: SELECT payment_method_code, party_phone FROM parties WHERE party_email = 'enrico09@example.com'


Question:
What is the payment method code and party phone of the party with the email 'enrico09@example.com'?
Additional table information: table: e_government

Answer: SELECT payment_method_code, party_phone FROM parties WHERE party_email = 'enrico09@example.com'


Question:
Find the emails of parties with the most popular party form.
Additional table information: table: e_government

Answer: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1)


Question:
What are the party emails associated with parties that used the party form that is the most common?
Additional table information: table: e_government

Answer: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1)


Question:
List all the name of organizations in order of the date formed.
Additional table information: table: e_government

Answer: SELECT organization_name FROM organizations ORDER BY date_formed ASC NULLS FIRST


Question:
What are the names of organizations, ordered by the date they were formed, ascending?
Additional table information: table: e_government

Answer: SELECT organization_name FROM organizations ORDER BY date_formed ASC NULLS FIRST


Question:
Find the name of the youngest organization.
Additional table information: table: e_government

Answer: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1


Question:
What is the name of the organization that was formed most recently?
Additional table information: table: e_government

Answer: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1


Question:
Find the last name of the latest contact individual of the organization 'Labour Party'.
Additional table information: table: e_government

Answer: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = 'Labour Party' ORDER BY t2.date_contact_to DESC LIMIT 1


Question:
What is the last name of the contact individual from the Labour party organization who was contacted most recently?
Additional table information: table: e_government

Answer: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = 'Labour Party' ORDER BY t2.date_contact_to DESC LIMIT 1


Question:
Find the last name of the first ever contact person of the organization with the highest UK Vat number.
Additional table information: table: e_government

Answer: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC NULLS FIRST LIMIT 1


Question:
What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations?
Additional table information: table: e_government

Answer: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC NULLS FIRST LIMIT 1


Question:
How many services are there?
Additional table information: table: e_government

Answer: SELECT COUNT(*) FROM services


Question:
Count the number of services.
Additional table information: table: e_government

Answer: SELECT COUNT(*) FROM services


Question:
Find name of the services that has never been used.
Additional table information: table: e_government

Answer: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id


Question:
What are the names of the services that have never been used?
Additional table information: table: e_government

Answer: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id


Question:
Find the name of all the cities and states.
Additional table information: table: e_government

Answer: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses


Question:
What are the names of all cities and states?
Additional table information: table: e_government

Answer: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses


Question:
How many cities are there in state 'Colorado'?
Additional table information: table: e_government

Answer: SELECT COUNT(*) FROM addresses WHERE state_province_county = 'Colorado'


Question:
Count the number of cities in the state of Colorado.
Additional table information: table: e_government

Answer: SELECT COUNT(*) FROM addresses WHERE state_province_county = 'Colorado'


Question:
Find the payment method code used by more than 3 parties.
Additional table information: table: e_government

Answer: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3


Question:
What are the payment method codes that have been used by more than 3 parties?
Additional table information: table: e_government

Answer: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3


Question:
Find the name of organizations whose names contain 'Party'.
Additional table information: table: e_government

Answer: SELECT organization_name FROM organizations WHERE organization_name LIKE '%Party%'