query_id
int64 0
2.15k
| database_id
stringclasses 40
values | table_id
listlengths 1
4
| query
stringlengths 22
185
| answer
stringlengths 22
608
| difficulty
stringclasses 4
values |
---|---|---|---|---|---|
1,900 |
planet_1
|
[
"planet",
"employee",
"shipment"
] |
What are the ids for all shipments on the planet Mars that Turanga Leela manages?
|
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";
|
extra
|
1,901 |
planet_1
|
[
"planet",
"shipment"
] |
What is the total shipments in each planet? List the planet name and total shipments.
|
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID GROUP BY T1.Planet;
|
medium
|
1,902 |
planet_1
|
[
"planet",
"shipment"
] |
How many shipments take place on each planet?
|
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID GROUP BY T1.Planet;
|
medium
|
1,903 |
planet_1
|
[
"planet",
"shipment"
] |
Which planet has most shipments? List the planet name.
|
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;
|
extra
|
1,904 |
planet_1
|
[
"planet",
"shipment"
] |
What is the name of the planet with the most shipments?
|
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;
|
extra
|
1,905 |
planet_1
|
[
"employee",
"shipment"
] |
List the manger's name and number of shipments under his management.
|
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Employee AS T2 ON T1.Manager = T2.EmployeeID GROUP BY T1.Manager;
|
medium
|
1,906 |
planet_1
|
[
"employee",
"shipment"
] |
What are the number of shipments managed and names of each manager?
|
SELECT T2.Name , count(*) FROM Shipment AS T1 JOIN Employee AS T2 ON T1.Manager = T2.EmployeeID GROUP BY T1.Manager;
|
medium
|
1,907 |
planet_1
|
[
"planet",
"shipment",
"package"
] |
Calculate total weight of package shipped on Mars.
|
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";
|
hard
|
1,908 |
planet_1
|
[
"planet",
"shipment",
"package"
] |
what is the total weight of all packages shipped on Mars?
|
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";
|
hard
|
1,909 |
planet_1
|
[
"shipment",
"planet",
"package"
] |
Calculate total weight of package shipped in each planet . show the name of each planet .
|
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;
|
hard
|
1,910 |
planet_1
|
[
"shipment",
"planet",
"package"
] |
what is the total package weight for each planet, list its name ?
|
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;
|
hard
|
1,911 |
planet_1
|
[
"planet",
"shipment",
"package"
] |
Which planet has total weight of shipment greater than 30? List planet name.
|
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;
|
hard
|
1,912 |
planet_1
|
[
"planet",
"shipment",
"package"
] |
What are the names of all planets tjat have a total shipment weight greater than 30?
|
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;
|
hard
|
1,913 |
planet_1
|
[
"planet",
"shipment",
"package",
"client"
] |
List package number of package shipped in planet Omicron Persei 8 and sent by Zapp Brannigan.
|
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";
|
extra
|
1,914 |
planet_1
|
[
"planet",
"shipment",
"package",
"client"
] |
What are the number of packages sent by Zapp Brannigan and shipped on the Omicron Persei 8?
|
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";
|
extra
|
1,915 |
planet_1
|
[
"planet",
"shipment",
"package",
"client"
] |
List package number of packages shipped in Omicron Persei 8 planet or sent by Zapp Brannigan.
|
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";
|
extra
|
1,916 |
planet_1
|
[
"planet",
"shipment",
"package",
"client"
] |
What are the number of packages shipped on Omicron Persei 8 planet or sent by Zapp Brannigan?
|
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";
|
extra
|
1,917 |
planet_1
|
[
"package"
] |
Which packages have weight between 10 and 30? List the package number and weight.
|
SELECT PackageNumber , Weight FROM PACKAGE WHERE Weight BETWEEN 10 AND 30;
|
medium
|
1,918 |
planet_1
|
[
"package"
] |
What are the package numbers and weights that are between 10 and 30?
|
SELECT PackageNumber , Weight FROM PACKAGE WHERE Weight BETWEEN 10 AND 30;
|
medium
|
1,919 |
planet_1
|
[
"employee",
"has_clearance",
"planet"
] |
Which employees do not have clearance in Mars? List employee's name.
|
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";
|
hard
|
1,920 |
planet_1
|
[
"employee",
"has_clearance",
"planet"
] |
What are the names of all employees who don't have clearance on Mars?
|
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";
|
hard
|
1,921 |
planet_1
|
[
"employee",
"has_clearance",
"planet"
] |
Which employees have clearance in Omega III? List employees' name.
|
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";
|
hard
|
1,922 |
planet_1
|
[
"employee",
"has_clearance",
"planet"
] |
What are the names of all employees with clearance on Omega III?
|
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";
|
hard
|
1,923 |
planet_1
|
[
"employee",
"has_clearance",
"planet"
] |
Which planets that have exact one employee has clearance? List planets' name.
|
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;
|
hard
|
1,924 |
planet_1
|
[
"employee",
"has_clearance",
"planet"
] |
What are the names of all planets with one employee that has clearance?
|
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;
|
hard
|
1,925 |
planet_1
|
[
"employee"
] |
Which employees have salaries between 5000 and 10000? List employees' name.
|
SELECT Name FROM Employee WHERE Salary BETWEEN 5000 AND 10000
|
easy
|
1,926 |
planet_1
|
[
"employee"
] |
What are the employees's names for those that have salaries between 5000 and 10000?
|
SELECT Name FROM Employee WHERE Salary BETWEEN 5000 AND 10000
|
easy
|
1,927 |
planet_1
|
[
"employee",
"employee"
] |
Find the name of employees whose salary is above the average salary or more than 5000.
|
SELECT Name FROM Employee WHERE Salary > 5000 OR Salary > (SELECT avg(salary) FROM employee)
|
extra
|
1,928 |
planet_1
|
[
"employee",
"employee"
] |
What are the names of all employees who have a salary greater than average or more than 5000?
|
SELECT Name FROM Employee WHERE Salary > 5000 OR Salary > (SELECT avg(salary) FROM employee)
|
extra
|
1,929 |
planet_1
|
[
"has_clearance",
"employee",
"planet"
] |
Find the number of employees who do not have clearance in Mars .
|
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" );
|
extra
|
1,930 |
planet_1
|
[
"has_clearance",
"employee",
"planet"
] |
What is the number of employees that do not have clearance on Mars ?
|
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" );
|
extra
|
1,931 |
video_game
|
[
"game"
] |
How many games are there?
|
SELECT count(*) FROM game
|
easy
|
1,932 |
video_game
|
[
"game"
] |
Count the number of games.
|
SELECT count(*) FROM game
|
easy
|
1,933 |
video_game
|
[
"game"
] |
List the Title and Developers of all games ordered by units sold from large to small.
|
SELECT Title , Developers FROM game ORDER BY Units_sold_Millions DESC
|
medium
|
1,934 |
video_game
|
[
"game"
] |
What are the titles and developers of all games, sorted by units sold descending?
|
SELECT Title , Developers FROM game ORDER BY Units_sold_Millions DESC
|
medium
|
1,935 |
video_game
|
[
"game"
] |
What is the average units sold in millions of the games that are not developed by Nintendo?
|
SELECT avg(Units_sold_Millions) FROM game WHERE developers != 'Nintendo'
|
easy
|
1,936 |
video_game
|
[
"game"
] |
Return the average number of units sold in millions for games not developed by Nintendo.
|
SELECT avg(Units_sold_Millions) FROM game WHERE developers != 'Nintendo'
|
easy
|
1,937 |
video_game
|
[
"platform"
] |
What are the names and market districts of all platforms?
|
SELECT Platform_name , Market_district FROM platform
|
medium
|
1,938 |
video_game
|
[
"platform"
] |
Return all platform names and corresponding market districts.
|
SELECT Platform_name , Market_district FROM platform
|
medium
|
1,939 |
video_game
|
[
"platform"
] |
What are the names and id of platforms whose download rank is 1?
|
SELECT Platform_name , Platform_ID FROM platform WHERE Download_rank = 1
|
medium
|
1,940 |
video_game
|
[
"platform"
] |
Return the names and ids of all platforms with the download rank of 1.
|
SELECT Platform_name , Platform_ID FROM platform WHERE Download_rank = 1
|
medium
|
1,941 |
video_game
|
[
"player"
] |
What are the maximum and minimum rank of the year of players.
|
SELECT max(Rank_of_the_year) , min(Rank_of_the_year) FROM player
|
medium
|
1,942 |
video_game
|
[
"player"
] |
Give the maximum and minimum rank of the year across all players.
|
SELECT max(Rank_of_the_year) , min(Rank_of_the_year) FROM player
|
medium
|
1,943 |
video_game
|
[
"player"
] |
How many players have rank of the year smaller than 3?
|
SELECT count(*) FROM player WHERE Rank_of_the_year <= 3
|
easy
|
1,944 |
video_game
|
[
"player"
] |
Count the number of players that have a rank of year of at most 3.
|
SELECT count(*) FROM player WHERE Rank_of_the_year <= 3
|
easy
|
1,945 |
video_game
|
[
"player"
] |
List all player names in ascending alphabetical order.
|
SELECT Player_name FROM player ORDER BY Player_name ASC
|
easy
|
1,946 |
video_game
|
[
"player"
] |
What are the names of all players in alphabetical order?
|
SELECT Player_name FROM player ORDER BY Player_name ASC
|
easy
|
1,947 |
video_game
|
[
"player"
] |
List names and colleges of all players in descending order of rank of the year.
|
SELECT Player_name , College FROM player ORDER BY Rank_of_the_year DESC
|
medium
|
1,948 |
video_game
|
[
"player"
] |
What are the names and colleges of all players, ordered by rank of year descending?
|
SELECT Player_name , College FROM player ORDER BY Rank_of_the_year DESC
|
medium
|
1,949 |
video_game
|
[
"game",
"game_player",
"player"
] |
Please show the names and rank of players that have played the game titled "Super Mario World".
|
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"
|
hard
|
1,950 |
video_game
|
[
"game",
"game_player",
"player"
] |
What are the names and ranks of players who have played the game with the title "Super Mario World"?
|
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"
|
hard
|
1,951 |
video_game
|
[
"game",
"game_player",
"player"
] |
Show the distinct developer of games played by players that go to college "Auburn".
|
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"
|
hard
|
1,952 |
video_game
|
[
"game",
"game_player",
"player"
] |
What are the different developers of games that are played by players that attend Auburn college?
|
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"
|
hard
|
1,953 |
video_game
|
[
"game",
"game_player",
"player"
] |
What is the average number of units sold in millions of games played by players with position "Guard"?
|
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"
|
hard
|
1,954 |
video_game
|
[
"game",
"game_player",
"player"
] |
Return the average number of units sold in millions among games played by players who have the position Guard.
|
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"
|
hard
|
1,955 |
video_game
|
[
"platform",
"game"
] |
Please list the title and platform name of games.
|
SELECT T1.Title , T2.Platform_name FROM game AS T1 JOIN platform AS T2 ON T1.Platform_ID = T2.Platform_ID
|
medium
|
1,956 |
video_game
|
[
"platform",
"game"
] |
What are the titles and platform names of all games?
|
SELECT T1.Title , T2.Platform_name FROM game AS T1 JOIN platform AS T2 ON T1.Platform_ID = T2.Platform_ID
|
medium
|
1,957 |
video_game
|
[
"platform",
"game"
] |
Please list the title of games with platforms that have market district in Asia or USA.
|
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"
|
hard
|
1,958 |
video_game
|
[
"platform",
"game"
] |
What are the titles of games that have platforms in the market districts of Asia or the USA?
|
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"
|
hard
|
1,959 |
video_game
|
[
"game"
] |
List the name of each franchise and the number of games belonging to that franchise.
|
SELECT Franchise , COUNT(*) FROM game GROUP BY Franchise
|
medium
|
1,960 |
video_game
|
[
"game"
] |
How many games are there from each Franchise?
|
SELECT Franchise , COUNT(*) FROM game GROUP BY Franchise
|
medium
|
1,961 |
video_game
|
[
"game"
] |
List the name of franchise that have the most number of games.
|
SELECT Franchise FROM game GROUP BY Franchise ORDER BY COUNT(*) DESC LIMIT 1
|
hard
|
1,962 |
video_game
|
[
"game"
] |
Which franchise has the most games?
|
SELECT Franchise FROM game GROUP BY Franchise ORDER BY COUNT(*) DESC LIMIT 1
|
hard
|
1,963 |
video_game
|
[
"game"
] |
List the names of franchises that have at least two games.
|
SELECT Franchise FROM game GROUP BY Franchise HAVING COUNT(*) >= 2
|
easy
|
1,964 |
video_game
|
[
"game"
] |
What are the names of franchises that have two or more games?
|
SELECT Franchise FROM game GROUP BY Franchise HAVING COUNT(*) >= 2
|
easy
|
1,965 |
video_game
|
[
"game_player",
"player"
] |
List the name of players that do not play any game.
|
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM game_player)
|
hard
|
1,966 |
video_game
|
[
"game_player",
"player"
] |
What are the names of players who do not play any games?
|
SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM game_player)
|
hard
|
1,967 |
video_game
|
[
"game",
"game_player",
"player"
] |
Show the title of games that are played by both players from college "Oklahoma" and players from college "Auburn".
|
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"
|
extra
|
1,968 |
video_game
|
[
"game",
"game_player",
"player"
] |
What are the titles of games that are played by players from Oklahoma college or Auburn college?
|
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"
|
extra
|
1,969 |
video_game
|
[
"game"
] |
Show all distinct franchises of games.
|
SELECT DISTINCT Franchise FROM game
|
easy
|
1,970 |
video_game
|
[
"game"
] |
What are all the distinct franchises?
|
SELECT DISTINCT Franchise FROM game
|
easy
|
1,971 |
video_game
|
[
"game",
"game_player",
"player"
] |
Show the title of games that are not played by any player who is in the Guard position.
|
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"
|
hard
|
1,972 |
video_game
|
[
"game",
"game_player",
"player"
] |
What are the titles of games not played by any players who play the Guard position?
|
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"
|
hard
|
1,973 |
book_press
|
[
"press"
] |
list all the names of press in descending order of the profit of the year.
|
SELECT name FROM press ORDER BY Year_Profits_billion DESC
|
easy
|
1,974 |
book_press
|
[
"press"
] |
Sorted all the press by year profits in descending order, and return press names.
|
SELECT name FROM press ORDER BY Year_Profits_billion DESC
|
easy
|
1,975 |
book_press
|
[
"press"
] |
What are the names of the publishers that made more than 15 billion profits each year or 1 billion each month?
|
SELECT name FROM press WHERE Year_Profits_billion > 15 OR Month_Profits_billion > 1
|
medium
|
1,976 |
book_press
|
[
"press"
] |
Find the press whose yearly profit is more than 15 billion or whose monthly profit is more than 1 billion. Return the press names.
|
SELECT name FROM press WHERE Year_Profits_billion > 15 OR Month_Profits_billion > 1
|
medium
|
1,977 |
book_press
|
[
"press"
] |
what are the average and maximum profit of a year for all presses?
|
SELECT avg(Year_Profits_billion) , max(Year_Profits_billion) FROM press
|
medium
|
1,978 |
book_press
|
[
"press"
] |
Find the average and maximum yearly profit for each press.
|
SELECT avg(Year_Profits_billion) , max(Year_Profits_billion) FROM press
|
medium
|
1,979 |
book_press
|
[
"press"
] |
Find the name of the publisher whose monthly profit is the highest.
|
SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1
|
medium
|
1,980 |
book_press
|
[
"press"
] |
Which press has the largest monthly profit? Give me the press name.
|
SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1
|
medium
|
1,981 |
book_press
|
[
"press"
] |
Find the name of the publisher whose monthly profit is the highest or the lowest.
|
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)
|
extra
|
1,982 |
book_press
|
[
"press"
] |
What are the names of the press that makes the highest monthly profit or the lowest monthly profit?
|
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)
|
extra
|
1,983 |
book_press
|
[
"author"
] |
how many authors are under age 30?
|
SELECT count(*) FROM author WHERE age < 30
|
easy
|
1,984 |
book_press
|
[
"author"
] |
Count the number of authors of age below 30.
|
SELECT count(*) FROM author WHERE age < 30
|
easy
|
1,985 |
book_press
|
[
"author"
] |
find the average age of authors for each gender.
|
SELECT avg(age) , gender FROM author GROUP BY gender
|
medium
|
1,986 |
book_press
|
[
"author"
] |
For each gender, return gender and the average age of authors.
|
SELECT avg(age) , gender FROM author GROUP BY gender
|
medium
|
1,987 |
book_press
|
[
"author"
] |
find the number of authors who are older than 30 for each gender.
|
SELECT count(*) , gender FROM author WHERE age > 30 GROUP BY gender
|
medium
|
1,988 |
book_press
|
[
"author"
] |
How many authors are of age above 30 for each gender?
|
SELECT count(*) , gender FROM author WHERE age > 30 GROUP BY gender
|
medium
|
1,989 |
book_press
|
[
"book"
] |
List all book titles in the order of their release date from the most recent to the past.
|
SELECT title FROM book ORDER BY release_date DESC
|
easy
|
1,990 |
book_press
|
[
"book"
] |
Sort all the books in descending order of release date, and return the book titles.
|
SELECT title FROM book ORDER BY release_date DESC
|
easy
|
1,991 |
book_press
|
[
"book"
] |
Find the number of books for each series.
|
SELECT count(*) , book_series FROM book GROUP BY book_series
|
medium
|
1,992 |
book_press
|
[
"book"
] |
How many books does each book series have? Return the counts and book series.
|
SELECT count(*) , book_series FROM book GROUP BY book_series
|
medium
|
1,993 |
book_press
|
[
"book"
] |
Find the titles and publish dates of the top 5 best sale books.
|
SELECT title , release_date FROM book ORDER BY sale_amount DESC LIMIT 5
|
medium
|
1,994 |
book_press
|
[
"book"
] |
What are the 5 best books in terms of sale amount? Give me their titles and release dates.
|
SELECT title , release_date FROM book ORDER BY sale_amount DESC LIMIT 5
|
medium
|
1,995 |
book_press
|
[
"book"
] |
Find the book series that have some book selling more than 1000 and some book less 500.
|
SELECT book_series FROM book WHERE sale_amount > 1000 INTERSECT SELECT book_series FROM book WHERE sale_amount < 500
|
hard
|
1,996 |
book_press
|
[
"book"
] |
Which book series contain both books with sale amount above 1000 and books with sale amount below 500?
|
SELECT book_series FROM book WHERE sale_amount > 1000 INTERSECT SELECT book_series FROM book WHERE sale_amount < 500
|
hard
|
1,997 |
book_press
|
[
"author",
"book"
] |
Find the name of authors who publish their books in both "MM" and "LT" series.
|
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'
|
extra
|
1,998 |
book_press
|
[
"author",
"book"
] |
Which authors publish books in both "MM" and "LT" series? Give me the author names.
|
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'
|
extra
|
1,999 |
book_press
|
[
"author",
"book"
] |
Find the name and age of the authors who do not have any book in the record.
|
SELECT name , age FROM author WHERE author_id NOT IN (SELECT author_id FROM book)
|
extra
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.