db_id
stringclasses
40 values
query
stringlengths
22
608
question
stringlengths
22
185
planet_1
SELECT T1.ShipmentID FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID JOIN Employee AS T3 ON T3.EmployeeID = T1.Manager WHERE T2.Name = "Mars" OR T3.Name = "Turanga Leela";
What are the ids for all shipments on the planet Mars that Turanga Leela manages?
planet_1
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID GROUP BY T1.Planet;
What is the total shipments in each planet? List the planet name and total shipments.
planet_1
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID GROUP BY T1.Planet;
How many shipments take place on each planet?
planet_1
SELECT T2.Name FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID GROUP BY T1.Planet ORDER BY count(*) DESC LIMIT 1;
Which planet has most shipments? List the planet name.
planet_1
SELECT T2.Name FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID GROUP BY T1.Planet ORDER BY count(*) DESC LIMIT 1;
What is the name of the planet with the most shipments?
planet_1
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Employee AS T2 ON T1.Manager = T2.EmployeeID GROUP BY T1.Manager;
List the manger's name and number of shipments under his management.
planet_1
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Employee AS T2 ON T1.Manager = T2.EmployeeID GROUP BY T1.Manager;
What are the number of shipments managed and names of each manager?
planet_1
SELECT sum(T1.Weight) FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID WHERE T3.Name = "Mars";
Calculate total weight of package shipped on Mars.
planet_1
SELECT sum(T1.Weight) FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID WHERE T3.Name = "Mars";
what is the total weight of all packages shipped on Mars?
planet_1
select t3.name , sum(t1.weight) from package as t1 join shipment as t2 on t1.shipment = t2.shipmentid join planet as t3 on t2.planet = t3.planetid group by t2.planet;
Calculate total weight of package shipped in each planet . show the name of each planet .
planet_1
select t3.name , sum(t1.weight) from package as t1 join shipment as t2 on t1.shipment = t2.shipmentid join planet as t3 on t2.planet = t3.planetid group by t2.planet;
what is the total package weight for each planet, list its name ?
planet_1
SELECT T3.Name FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID GROUP BY T2.Planet HAVING sum(T1.Weight) > 30;
Which planet has total weight of shipment greater than 30? List planet name.
planet_1
SELECT T3.Name FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID GROUP BY T2.Planet HAVING sum(T1.Weight) > 30;
What are the names of all planets tjat have a total shipment weight greater than 30?
planet_1
SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name = "Zapp Brannigan" AND T4.Name = "Omicron Persei 8";
List package number of package shipped in planet Omicron Persei 8 and sent by Zapp Brannigan.
planet_1
SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name = "Zapp Brannigan" AND T4.Name = "Omicron Persei 8";
What are the number of packages sent by Zapp Brannigan and shipped on the Omicron Persei 8?
planet_1
SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name = "Zapp Brannigan" OR T4.Name = "Omicron Persei 8";
List package number of packages shipped in Omicron Persei 8 planet or sent by Zapp Brannigan.
planet_1
SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name = "Zapp Brannigan" OR T4.Name = "Omicron Persei 8";
What are the number of packages shipped on Omicron Persei 8 planet or sent by Zapp Brannigan?
planet_1
SELECT PackageNumber , Weight FROM PACKAGE WHERE Weight BETWEEN 10 AND 30;
Which packages have weight between 10 and 30? List the package number and weight.
planet_1
SELECT PackageNumber , Weight FROM PACKAGE WHERE Weight BETWEEN 10 AND 30;
What are the package numbers and weights that are between 10 and 30?
planet_1
SELECT Name FROM Employee EXCEPT SELECT T2.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID WHERE T3.Name = "Mars";
Which employees do not have clearance in Mars? List employee's name.
planet_1
SELECT Name FROM Employee EXCEPT SELECT T2.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID WHERE T3.Name = "Mars";
What are the names of all employees who don't have clearance on Mars?
planet_1
SELECT T2.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID WHERE T3.Name = "Omega III";
Which employees have clearance in Omega III? List employees' name.
planet_1
SELECT T2.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID WHERE T3.Name = "Omega III";
What are the names of all employees with clearance on Omega III?
planet_1
SELECT T3.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID GROUP BY T1.Planet HAVING count(*) = 1;
Which planets that have exact one employee has clearance? List planets' name.
planet_1
SELECT T3.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID GROUP BY T1.Planet HAVING count(*) = 1;
What are the names of all planets with one employee that has clearance?
planet_1
SELECT Name FROM Employee WHERE Salary BETWEEN 5000 AND 10000
Which employees have salaries between 5000 and 10000? List employees' name.
planet_1
SELECT Name FROM Employee WHERE Salary BETWEEN 5000 AND 10000
What are the employees's names for those that have salaries between 5000 and 10000?
planet_1
SELECT Name FROM Employee WHERE Salary > 5000 OR Salary > (SELECT avg(salary) FROM employee)
Find the name of employees whose salary is above the average salary or more than 5000.
planet_1
SELECT Name FROM Employee WHERE Salary > 5000 OR Salary > (SELECT avg(salary) FROM employee)
What are the names of all employees who have a salary greater than average or more than 5000?
planet_1
select count(*) from employee where employeeid not in ( select t2.employeeid from has_clearance as t1 join employee as t2 on t1.employee = t2.employeeid join planet as t3 on t1.planet = t3.planetid where t3.name = "mars" );
Find the number of employees who do not have clearance in Mars .
planet_1
select count(*) from employee where employeeid not in ( select t2.employeeid from has_clearance as t1 join employee as t2 on t1.employee = t2.employeeid join planet as t3 on t1.planet = t3.planetid where t3.name = "mars" );
What is the number of employees that do not have clearance on Mars ?
video_game
SELECT count(*) FROM game
How many games are there?
video_game
SELECT count(*) FROM game
Count the number of games.
video_game
SELECT Title , Developers FROM game ORDER BY Units_sold_Millions DESC
List the Title and Developers of all games ordered by units sold from large to small.
video_game
SELECT Title , Developers FROM game ORDER BY Units_sold_Millions DESC
What are the titles and developers of all games, sorted by units sold descending?
video_game
SELECT avg(Units_sold_Millions) FROM game WHERE developers != 'Nintendo'
What is the average units sold in millions of the games that are not developed by Nintendo?
video_game
SELECT avg(Units_sold_Millions) FROM game WHERE developers != 'Nintendo'
Return the average number of units sold in millions for games not developed by Nintendo.
video_game
SELECT Platform_name , Market_district FROM platform
What are the names and market districts of all platforms?
video_game
SELECT Platform_name , Market_district FROM platform
Return all platform names and corresponding market districts.
video_game
SELECT Platform_name , Platform_ID FROM platform WHERE Download_rank = 1
What are the names and id of platforms whose download rank is 1?
video_game
SELECT Platform_name , Platform_ID FROM platform WHERE Download_rank = 1
Return the names and ids of all platforms with the download rank of 1.
video_game
SELECT max(Rank_of_the_year) , min(Rank_of_the_year) FROM player
What are the maximum and minimum rank of the year of players.
video_game
SELECT max(Rank_of_the_year) , min(Rank_of_the_year) FROM player
Give the maximum and minimum rank of the year across all players.
video_game
SELECT count(*) FROM player WHERE Rank_of_the_year <= 3
How many players have rank of the year smaller than 3?
video_game
SELECT count(*) FROM player WHERE Rank_of_the_year <= 3
Count the number of players that have a rank of year of at most 3.
video_game
SELECT Player_name FROM player ORDER BY Player_name ASC
List all player names in ascending alphabetical order.
video_game
SELECT Player_name FROM player ORDER BY Player_name ASC
What are the names of all players in alphabetical order?
video_game
SELECT Player_name , College FROM player ORDER BY Rank_of_the_year DESC
List names and colleges of all players in descending order of rank of the year.
video_game
SELECT Player_name , College FROM player ORDER BY Rank_of_the_year DESC
What are the names and colleges of all players, ordered by rank of year descending?
video_game
SELECT T3.Player_name , T3.rank_of_the_year FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T1.Title = "Super Mario World"
Please show the names and rank of players that have played the game titled "Super Mario World".
video_game
SELECT T3.Player_name , T3.rank_of_the_year FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T1.Title = "Super Mario World"
What are the names and ranks of players who have played the game with the title "Super Mario World"?
video_game
SELECT DISTINCT T1.Developers FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.College = "Auburn"
Show the distinct developer of games played by players that go to college "Auburn".
video_game
SELECT DISTINCT T1.Developers FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.College = "Auburn"
What are the different developers of games that are played by players that attend Auburn college?
video_game
SELECT avg(Units_sold_Millions) FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.Position = "Guard"
What is the average number of units sold in millions of games played by players with position "Guard"?
video_game
SELECT avg(Units_sold_Millions) FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.Position = "Guard"
Return the average number of units sold in millions among games played by players who have the position Guard.
video_game
SELECT T1.Title , T2.Platform_name FROM game AS T1 JOIN platform AS T2 ON T1.Platform_ID = T2.Platform_ID
Please list the title and platform name of games.
video_game
SELECT T1.Title , T2.Platform_name FROM game AS T1 JOIN platform AS T2 ON T1.Platform_ID = T2.Platform_ID
What are the titles and platform names of all games?
video_game
SELECT T1.Title FROM game AS T1 JOIN platform AS T2 ON T1.Platform_ID = T2.Platform_ID WHERE T2.Market_district = "Asia" OR T2.Market_district = "USA"
Please list the title of games with platforms that have market district in Asia or USA.
video_game
SELECT T1.Title FROM game AS T1 JOIN platform AS T2 ON T1.Platform_ID = T2.Platform_ID WHERE T2.Market_district = "Asia" OR T2.Market_district = "USA"
What are the titles of games that have platforms in the market districts of Asia or the USA?
video_game
SELECT Franchise , COUNT(*) FROM game GROUP BY Franchise
List the name of each franchise and the number of games belonging to that franchise.
video_game
SELECT Franchise , COUNT(*) FROM game GROUP BY Franchise
How many games are there from each Franchise?
video_game
SELECT Franchise FROM game GROUP BY Franchise ORDER BY COUNT(*) DESC LIMIT 1
List the name of franchise that have the most number of games.
video_game
SELECT Franchise FROM game GROUP BY Franchise ORDER BY COUNT(*) DESC LIMIT 1
Which franchise has the most games?
video_game
SELECT Franchise FROM game GROUP BY Franchise HAVING COUNT(*) >= 2
List the names of franchises that have at least two games.
video_game
SELECT Franchise FROM game GROUP BY Franchise HAVING COUNT(*) >= 2
What are the names of franchises that have two or more games?
video_game
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM game_player)
List the name of players that do not play any game.
video_game
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM game_player)
What are the names of players who do not play any games?
video_game
SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.College = "Oklahoma" INTERSECT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.College = "Auburn"
Show the title of games that are played by both players from college "Oklahoma" and players from college "Auburn".
video_game
SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.College = "Oklahoma" INTERSECT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.College = "Auburn"
What are the titles of games that are played by players from Oklahoma college or Auburn college?
video_game
SELECT DISTINCT Franchise FROM game
Show all distinct franchises of games.
video_game
SELECT DISTINCT Franchise FROM game
What are all the distinct franchises?
video_game
SELECT Title FROM game EXCEPT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.Position = "Guard"
Show the title of games that are not played by any player who is in the Guard position.
video_game
SELECT Title FROM game EXCEPT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID = T2.Game_ID JOIN player AS T3 ON T2.Player_ID = T3.Player_ID WHERE T3.Position = "Guard"
What are the titles of games not played by any players who play the Guard position?
book_press
SELECT name FROM press ORDER BY Year_Profits_billion DESC
list all the names of press in descending order of the profit of the year.
book_press
SELECT name FROM press ORDER BY Year_Profits_billion DESC
Sorted all the press by year profits in descending order, and return press names.
book_press
SELECT name FROM press WHERE Year_Profits_billion > 15 OR Month_Profits_billion > 1
What are the names of the publishers that made more than 15 billion profits each year or 1 billion each month?
book_press
SELECT name FROM press WHERE Year_Profits_billion > 15 OR Month_Profits_billion > 1
Find the press whose yearly profit is more than 15 billion or whose monthly profit is more than 1 billion. Return the press names.
book_press
SELECT avg(Year_Profits_billion) , max(Year_Profits_billion) FROM press
what are the average and maximum profit of a year for all presses?
book_press
SELECT avg(Year_Profits_billion) , max(Year_Profits_billion) FROM press
Find the average and maximum yearly profit for each press.
book_press
SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1
Find the name of the publisher whose monthly profit is the highest.
book_press
SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1
Which press has the largest monthly profit? Give me the press name.
book_press
SELECT name FROM press WHERE Month_Profits_billion = (SELECT min(Month_Profits_billion) FROM press) OR Month_Profits_billion = (SELECT max(Month_Profits_billion) FROM press)
Find the name of the publisher whose monthly profit is the highest or the lowest.
book_press
SELECT name FROM press WHERE Month_Profits_billion = (SELECT min(Month_Profits_billion) FROM press) OR Month_Profits_billion = (SELECT max(Month_Profits_billion) FROM press)
What are the names of the press that makes the highest monthly profit or the lowest monthly profit?
book_press
SELECT count(*) FROM author WHERE age < 30
how many authors are under age 30?
book_press
SELECT count(*) FROM author WHERE age < 30
Count the number of authors of age below 30.
book_press
SELECT avg(age) , gender FROM author GROUP BY gender
find the average age of authors for each gender.
book_press
SELECT avg(age) , gender FROM author GROUP BY gender
For each gender, return gender and the average age of authors.
book_press
SELECT count(*) , gender FROM author WHERE age > 30 GROUP BY gender
find the number of authors who are older than 30 for each gender.
book_press
SELECT count(*) , gender FROM author WHERE age > 30 GROUP BY gender
How many authors are of age above 30 for each gender?
book_press
SELECT title FROM book ORDER BY release_date DESC
List all book titles in the order of their release date from the most recent to the past.
book_press
SELECT title FROM book ORDER BY release_date DESC
Sort all the books in descending order of release date, and return the book titles.
book_press
SELECT count(*) , book_series FROM book GROUP BY book_series
Find the number of books for each series.
book_press
SELECT count(*) , book_series FROM book GROUP BY book_series
How many books does each book series have? Return the counts and book series.
book_press
SELECT title , release_date FROM book ORDER BY sale_amount DESC LIMIT 5
Find the titles and publish dates of the top 5 best sale books.
book_press
SELECT title , release_date FROM book ORDER BY sale_amount DESC LIMIT 5
What are the 5 best books in terms of sale amount? Give me their titles and release dates.
book_press
SELECT book_series FROM book WHERE sale_amount > 1000 INTERSECT SELECT book_series FROM book WHERE sale_amount < 500
Find the book series that have some book selling more than 1000 and some book less 500.
book_press
SELECT book_series FROM book WHERE sale_amount > 1000 INTERSECT SELECT book_series FROM book WHERE sale_amount < 500
Which book series contain both books with sale amount above 1000 and books with sale amount below 500?
book_press
SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id = t2.author_id WHERE t2.book_series = 'MM' INTERSECT SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id = t2.author_id WHERE t2.book_series = 'LT'
Find the name of authors who publish their books in both "MM" and "LT" series.
book_press
SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id = t2.author_id WHERE t2.book_series = 'MM' INTERSECT SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id = t2.author_id WHERE t2.book_series = 'LT'
Which authors publish books in both "MM" and "LT" series? Give me the author names.
book_press
SELECT name , age FROM author WHERE author_id NOT IN (SELECT author_id FROM book)
Find the name and age of the authors who do not have any book in the record.