db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
ice_hockey_draft
Please list the names of all the players that are over 90 kg and are right-shooted.
names of the players refers to PlayerName; over 90 kg refers to weight_in_kg > 90; right-shooted refers to shoots = 'R';
SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
airline
How many cancelled flights are there?
cancelled flights refers to CANCELLED = 1;
SELECT COUNT(*) FROM Airlines WHERE CANCELLED = 1
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
What is the genre of the game "Mario vs. Donkey Kong"?
genre refers to genre_name; game "Mario vs. Donkey Kong" refers to game_name = 'Mario vs. Donkey Kong'
SELECT T1.genre_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T2.game_name = 'Mario vs. Donkey Kong'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
ice_hockey_draft
Among all the players that are right-shooted, how many of them weigh over 90 kg?
right-shooted refers to shoots = 'R'; weigh over 90 kg refers to weight_in_kg > 90;
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
books
What is the name of the publisher of the book "The Illuminati"?
"The Illuminati" is the title of the book; name of publisher refers to publisher_name
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Illuminati'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
List the platforms that release the most games each year.
platform refers to platform_id; the most games refers to max(count(game_publisher_id))
SELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id GROUP BY T2.release_year, T1.platform_name ORDER BY COUNT(DISTINCT T3.game_id) DESC
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
ice_hockey_draft
How much taller is David Bornhammar than Pauli Levokari in centimeters?
how much taller = SUBTRACT(SUM(height_in_cm WHERE PlayerName = 'David Bornhammar'), SUM(height_in_cm WHERE PlayerName = 'Pauli Levokari')); height in centimeters refers to height_in_cm;
SELECT ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar' ) - ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'Pauli Levokari' )
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
video_games
List all the platform games.
platform game refers to genre_name = 'Platform'; game refers to game_name
SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Platform'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
Which country does Ranchi city belong to?
country refers to Country_Name; Ranchi city refers to City_Name = 'Ranchi'
SELECT T2.Country_Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id WHERE T1.City_Name = 'Ranchi'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
ice_hockey_draft
What is the weight of the player with the longest time on ice in the player’s first 7 years of NHL career in kilograms?
weight in kilograms refers to weight_in_kg; longest time on ice in the player's first 7 years of NHL career refers to MAX(sum_7yr_TOI);
SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.sum_7yr_TOI = ( SELECT MAX(t.sum_7yr_TOI) FROM PlayerInfo t )
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
video_games
What are the games that were released in 2006?
game refers to game_name; released in 2006 refers to release_year = 2006
SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2006
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
ice_hockey_draft
Among the players that weigh more than 90 kg, what is the name of the player that has the most attendance in the player's first 7 years of NHL career?
weigh more than 90 kg refers to weight_in_kg > 90; name of the player refers to PlayerName; most attendance in the player's first 7 years of NHL career refers to MAX(sum_7yr_GP);
SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.sum_7yr_GP = ( SELECT MAX(T1.sum_7yr_GP) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 )
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
books
Please give the title of the oldest book published by publisher "Thomas Nelson".
"Thomas Nelson" is the publisher_name; oldest book refers to Min(publication_date)
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' ORDER BY T1.publication_date ASC LIMIT 1
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
Which game has the most sales in Japan?
which game refers to game_name; most sales refers to MAX(num_sales); Japan refers to region_name = 'Japan';
SELECT T5.game_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC ...
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
Who was the man of the series in 2013? Give the full name.
full name refers to Player_Name; in 2013 refers to Season_Year = 2013
SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2013
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
ice_hockey_draft
Among the players that weigh more than 90 kg, how many of them have a position of defense?
weigh more than 90 kg refers to weight_in_kg > 90; position of defense refers to position_info = 'D' ;
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.position_info = 'D'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
airline
Provide the origin of the flight that has the shortest actual elapsed time.
shortest actual elapsed time refers to MIN(ACTUAL_ELAPSED_TIME);
SELECT ORIGIN FROM Airlines ORDER BY ACTUAL_ELAPSED_TIME ASC LIMIT 1
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
Which publisher published the most games?
publisher refers to publisher_name; the most games refers to max(count(game_id))
SELECT T.publisher_name FROM ( SELECT T1.publisher_name, COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id GROUP BY T1.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1 ) t
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
What is the batting hand of MK Pandey?
MK Pandey refers to Player_Name = 'MK Pandey'
SELECT T2.Batting_hand FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T1.Player_Name = 'MK Pandey'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
ice_hockey_draft
How many players weigh more than 90 kg?
weigh more than 90 kg refers to weight_in_kg > 90;
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
books
What is the name of the publisher that has published the most number of books?
name of publisher refers to publisher_name; publisher published the most number of books refers to Max(Count(book_id))
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T1.book_id) DESC LIMIT 1
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
soccer_2016
What is the nationality of the 7th season Purple Cap winner?
nationality refers to Country_Name; the 7th season refers to Season_Id = 7; Purple Cap winner refers to Purple_Cap IS NOT NULL
SELECT T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Id = 7 AND T1.Purple_Cap IS NOT NULL
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
ice_hockey_draft
How much does David Bornhammar weigh in kilograms?
weigh in kilograms refers to weight_in_kg;
SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'David Bornhammar'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
airline
List the tail number of flights that flew on August 17, 2018.
tail number refers to TAIL_NUM; on August 17, 2018 refers to FL_DATE = '2018/8/17';
SELECT TAIL_NUM FROM Airlines WHERE FL_DATE = '2018/8/17' GROUP BY TAIL_NUM
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
What are the years that "WiiU" got a new game?
year refers to release_year; "WiiU" refers to platform_name = 'WiiU'
SELECT T2.release_year FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T1.platform_name = 'WiiU' ORDER BY T2.release_year DESC LIMIT 1
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
State the name of the city with the most venues.
name of the city refers to City_Name; the most venues refers to max(count(Venue_Id))
SELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T1.City_Id = T2.City_Id GROUP BY T1.City_Id ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
ice_hockey_draft
What is the name of the tallest player?
tallest player refers to MAX(height_in_cm);
SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id ORDER BY T2.height_in_cm DESC LIMIT 1
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
books
What is the name of the publisher of the book with the most pages?
book with the most pages refers to Max(num_pages); name of publisher refers to publisher_name
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id ORDER BY T1.num_pages DESC LIMIT 1
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
Name the game released in 2011.
game refers to game_name; released in 2011 refers to release_year = 2011
SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2011
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
ice_hockey_draft
Among the players with a height of over 6'2" inches, how many of them were born in Sweden?
height of over 6'2" inches refers to height_in_inch > '6''2"'; born in Sweden refers to nation = 'Sweden' ;
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2"' AND T1.nation = 'Sweden'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
video_games
Provide the ID of the most popular platform in Europe.
ID refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'
SELECT T.game_platform_id FROM ( SELECT T1.game_platform_id, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' GROUP BY T1.game_platform_id ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
How many times does M Chinnaswamy Stadium host games than Maharashtra Cricket Association Stadium?
M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'; Maharashtra Cricket Association Stadium refers to Venue_Name = 'Maharashtra Cricket Association Stadium'; how many times = divide(count(Match_Id where Venue_Name = 'M Chinnaswamy Stadium'), count(Match_Id where Venue_Name = 'Maharashtra Cricket Assoc...
SELECT SUM(CASE WHEN T2.Venue_Name = 'M Chinnaswamy Stadium' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.Venue_Name = 'Maharashtra Cricket Association Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
ice_hockey_draft
Please list the names of all the players with a height of over 6'2" inches.
name of the players refers to PlayerName; height of over 6'2" inches refers to height_in_inch > '6''2"' ;
SELECT DISTINCT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2"'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
airline
Please list any three airports with their codes.
null
SELECT Code, Description FROM Airports LIMIT 3
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
Which game has the longest name?
game refers to game_name; the longest name refers to max(length(game_name))
SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
ice_hockey_draft
What is the height of David Bornhammar in inches?
heigh in inches refers to height_in_inch;
SELECT T2.height_in_inch FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar'
CREATE TABLE PlayerInfo ( CSS_rank INTEGER, -- draftyear INTEGER, -- Example Values: `1999`, `2001`, `2002`, `2000`, `1998` | Value Statics: Total count 2171 - Distinct count 10 - Null count 0 GP_greater_than_0 TEXT, -- Example Values: `no`, `yes` | Value Statics: Total count 2171 - Distinct count 2 - Null coun...
books
Among the books published by publisher "Thomas Nelson", how many of them have over 300 pages?
"Thomas Nelson" is the publisher_name; books with over 300 pages refers to num_pages > 300
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' AND T1.num_pages > 300
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
soccer_2016
How many Indian cities are there in the database?
Indian refers to Country_Name = 'India'
SELECT SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How much is the discounted price of every item that customer 111511 ordered in order 53159? List the names of the parts of every item.
discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)); customer 111511 refers to o_custkey = 111511; order 53159 refers to o_orderkey = 53159; name of the part refers to p_name
SELECT T2.l_extendedprice * (1 - T2.l_discount), T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 111511 AND T1.o_orderkey = 53159
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
airline
How many flights on the 1st of August 2018 were coming from Allentown, Pennsylvania?
1st of August 2018 refers to FL_DATE = '2018/8/1'; coming from Allentown, Pennsylvania refers to ORIGIN = 'ABE';
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'ABE'
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
retails
What are the names of the parts that were ordered by customer 110942?
name of the part refers to p_name; customer 110942 refers to o_custkey = 110942
SELECT T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 110942
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
video_games
How many games were released in 2001?
released in 2001 refers to release_year = 2001
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 2001
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
How many players were born in the 90s?
born in the 90s refers to DOB > = '1990-01-01' AND DOB < = '1999-12-31'
SELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
What is the total amount of tax charged for the order placed by customer 88931 on 7/13/994?
total amount of tax refers to sum(multiply(multiply(l_extendedprice, subtract(1, l_discount)), add(1, l_tax))); customer 88931 refers to o_custkey = 88931; on 7/13/1994 refers to o_orderdate = '1994-07-13'
SELECT SUM(T2.l_extendedprice * (1 - T2.l_discount) * (1 + T2.l_tax)) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = 88931 AND T1.o_orderdate = '1994-07-13'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
soccer_2016
In the database, how many times is the number of Indian cities to the South African cities?
Indian refers to Country_Name = 'India'; South African refers to Country_Name = 'South Africa'; how many times = divide(count(City_Id where Country_Name = 'India'), count(City_Id where Country_Name = 'South Africa'))
SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
What are the total quantities of the items ordered by customer 101660 on 10/5/1995?
total quantity refers to sum(l_quantity); customer 101660 refers to o_custkey = 101660; on 10/5/1995 refers to o_orderdate = '1995-10-05'
SELECT SUM(T2.l_quantity) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1995-10-05' AND T1.o_custkey = 101660
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
Please list the titles of all the books in British English.
"British English" is the language_name of the book
SELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'British English'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.
in North America refers to region_name = 'North America'; platform ID 9577 refers to game_platform_id = 9577; percent = divide(subtract(num_sales where region_name = 'North America' and game_platform_id = 9577, avg(num_sales)), avg(num_sales)) * 100%
SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
How many matches were played on May 2008?
in May 2008 refers to SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5'
SELECT SUM(CASE WHEN SUBSTR(Match_Date, 7, 1) = '5' THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
Who is the clerk in charge of handling the item with the highest amount of extended price?
clerk refers to o_clerk; the highest amount of extended price refers to max(l_extendedprice)
SELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T2.l_extendedprice DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
airline
Give the actual elapsed time of the flights with air carrier named Semo Aviation Inc.: SEM.
actual elapsed time refers to ACTUAL_ELAPSED_TIME; Semo Aviation Inc.: SEM. Refers to Description = 'Semo Aviation Inc.: SEM';
SELECT T2.ACTUAL_ELAPSED_TIME FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Semo Aviation Inc.: SEM'
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
Mention the genre of the 2Xtreme.
genre refers to genre_name; the 2Xtreme game refers to game_name = '2Xtreme'
SELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
retails
What is the name of the country of the supplier with the highest debt?
name of the country refers to n_name; the highest debt refers to min(s_acctbal)
SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_suppkey DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
How many books are in English?
books in English refers to language_name = 'English'
SELECT COUNT(*) FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'English'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
retails
What are the names of the parts that have a part supply cost of at least 1,000?
name of the part refers to p_name; part supply cost of at least 1,000 refers to ps_supplycost > 1000
SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_supplycost > 1000
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
airline
Provide the date and tail number of flight with air carrier "Ross Aviation Inc.: GWE".
date of flight refers to FL_DATE; tail number of flight refers to TAIL_NUM; Ross Aviation Inc.: GWE refers to Description = 'Ross Aviation Inc.: GWE';
SELECT T1.FL_DATE, T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Ross Aviation Inc.: GWE'
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
Provide the platform where the Panzer Tactics can be played.
platform refers to platform_name; the Panzer Tactics is a game name.
SELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Panzer Tactics'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
retails
What are the top 2 countries with the highest number of indebted suppliers?
country refers to c_name; highest number of indebted refers to max(sum(acctbal)) where s_acctbal < 0
SELECT T.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T1.s_nationkey ) AS T ORDER BY T.num LIMIT 2
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
video_games
Please list the names of the publishers of all the puzzle games.
name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'
SELECT DISTINCT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
List the id of the player who won the Orange Cap for 2 consecutive seasons.
id of the player who won the Orange Cap refers to Orange_Cap; for 2 consecutive seasons refers to count(Season_Year) > 1
SELECT Orange_Cap FROM Season GROUP BY Orange_Cap HAVING COUNT(Season_Year) > 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How much is the part supply cost for the medium metallic grey dodger linen?
part supply cost refers to ps_supplycost; medium metallic grey dodger linen refers to p_name = 'medium metallic grey dodger linen'
SELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'medium metallic grey dodger linen'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
Please list the titles of all the books that Lucas Wyldbore has ordered.
null
SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
soccer_2016
Who is the oldest player?
name of the player refers to Player_Name; the oldest refers to min(DOB)
SELECT Player_Name FROM Player ORDER BY DOB ASC LIMIT 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
Which country has the least number of suppliers?
country refers to n_name; the least number of suppliers refers to min(count(s_name))
SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey GROUP BY T1.s_nationkey ORDER BY COUNT(T1.s_name) LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
airline
List the air carrier description and code of the flight with the shortest arrival time.
shortest arrival time refers to MIN(ARR_TIME);
SELECT T1.Description, T1.Code FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.ARR_TIME ASC LIMIT 1
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
How many games were sold on the DS platform on average in the 4 different regions?
on the DS platform refers to platform_name = 'DS'; number of games sold on average = divide(sum(multiply(num_sales, 100000)), 4) where platform_name = 'DS'
SELECT SUM(T1.num_sales) * 100000 / 4 FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T3.platform_name = 'DS'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
What is the name of the player with the highest number of outstanding player awards in a particular match?
name of the player refers to Player_Name; the highest number of outstanding player awards refers to max(count(Man_of_the_Match))
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match GROUP BY T2.Man_of_the_Match ORDER BY COUNT(T2.Man_of_the_Match) DESC LIMIT 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How many customers in the building segments have orders with a total price of no less than 50,000?
building segment refers to c_mktsegment = 'BUILDING'; a total price of no less than 50,000 refers to o_totalprice > 50000
SELECT COUNT(T2.c_name) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'BUILDING' AND T1.o_totalprice > 50000
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
What is the cheapest order price of the book "The Little House"?
"The Little House" is the title of book; cheapest order price refers to Min(price)
SELECT MIN(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Little House'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
soccer_2016
How many matches did Team 10 play in 2012?
Team 10 refers to Team_1 = 10 OR Team_2 = 10; in 2012 refers to SUBSTR(Match_Date, 1, 4) = '2012'
SELECT SUM(CASE WHEN Team_1 = 10 OR Team_2 = 10 THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2012'
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How much is the total price of all the orders shipped to customers in Argentina?
total price = sum(o_totalprice); Argentina refers to n_name = 'Argentina'
SELECT SUM(T3.o_totalprice) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey INNER JOIN orders AS T3 ON T1.c_custkey = T3.o_custkey WHERE T2.n_name = 'ARGENTINA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
video_games
What is the total number of sales across all regions?
total number of sales = sum(num_sales)
SELECT SUM(T.num_sales) * 100000 FROM region_sales t
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
How many umpires are from South Africa?
South Africa refers to Country_Name = 'South Africa'
SELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
What is the name of the customer whose order was delivered the longest?
name of the customer refers to c_name; delivered the longest refers to max(subtract(l_receiptdate, l_commitdate))
SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY (JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate)) DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
What is the total price of all the books ordered by Lucas Wyldbore?
total price refers to Sum(price)
SELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
Name the publisher of the Chronicles of the Sword game.
publisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword'
SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = 'Chronicles of the Sword'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
How many Orange Cap awards were won by CH Gayle?
CH Gayle refers to Player_Name = 'CH Gayle'
SELECT SUM(CASE WHEN T1.Player_Name = 'CH Gayle' THEN 1 ELSE 0 END) AS cnt FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Orange_Cap
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How many urgent orders did Clerk#000000001 handle in 1997?
urgent order refers to o_orderpriority = '1-URGENT'; Clerk#000000001 refers to o_clerk = 'Clerk#000000001'; 1997 refers to year(o_orderdate) = 1997
SELECT COUNT(o_orderkey) FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1997' AND o_clerk = 'Clerk#000000001' AND o_orderpriority = '1-URGENT'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
soccer_2016
How many matches were played in Season 7?
Season 7 refers to Season_Id = 7
SELECT COUNT(Match_Id) FROM `Match` WHERE Season_Id = 7
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How many customers in the machinery segment are in debt?
machinery segment refers to c_mktsegment = 'MACHINERY'; in debt refers to c_acctbal < 0
SELECT COUNT(c_custkey) FROM customer WHERE c_acctbal < 0 AND c_mktsegment = 'MACHINERY'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
airline
Provide the air carrier description of all flights arriving at Miami.
arriving at Miami refers to DEST = 'MIA';
SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEST = 'MIA'
CREATE TABLE Airlines ( CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 CRS_DEP_TIME INTEGER, -- CRS_ELAPSED_TIME INTEGER, -- CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu...
video_games
In which year was Panzer Tactics released on DS?
year refers to release_year; Panzer Tactics refers to game_name = 'Panzer Tactics'; on DS refers to platform_name = 'DS'
SELECT T4.release_year FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T5.platform_name...
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
In which country do the majority of the players are from?
country refers to Country_Name; the majority of the players  refers to max(count(Country_Name))
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name GROUP BY T2.Country_Name ORDER BY COUNT(T2.Country_Name) DESC LIMIT 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
Among the items shipped in 1994 via truck, how many items were returned?
1994 refers to year(l_shipdate) = 1994; via truck refers to l_shipmode = 'TRUCK'; returned refers to l_returnflag = 'R'
SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994' AND l_returnflag = 'R' AND l_shipmode = 'TRUCK'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
video_games
State the name of the publisher with the most games.
name of publisher refers to publisher_name; the most games refers to max(game_id)
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
What is the name of the team that won the most number of matches in season 1?
name of the team refers to Team_Name; the most number of matches refers to max(count(Match_Winner)); season 1 refers to season_Id = 1
SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT Match_Winner FROM `Match` WHERE season_Id = 1 GROUP BY Match_Winner ORDER BY COUNT(Match_Winner) DESC LIMIT 1 )
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
How many customers are in the furniture segment?
furniture segment refers to c_mktsegment = 'FURNITURE'
SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
Which city does the address id 547 belong to?
null
SELECT city FROM address WHERE address_id = 547
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
How many platforms are available for the game Pro Evolution Soccer 2016?
game Pro Evolution Soccer 2016 refers to game_name = 'Pro Evolution Soccer 2016'
SELECT COUNT(T2.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Pro Evolution Soccer 2016'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
retails
In 1997, how many orders were shipped via mail?
1997 refers to year(l_shipdate) = 1997; shipped via mail refers to l_shipmode = 'MAIL'
SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1997' AND l_shipmode = 'MAIL'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
video_games
State the publisher name of the game "ModNation Racers".
game "ModNation Racers" refers to game_name = 'ModNation Racers'
SELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'ModNation Racers'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
retails
Which market segment does the customer with the highest amount of debt belongs to?
market segment refers to c_mktsegment; the highest amount of debt refers to max(c_acctbal)
SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
Among the books ordered by Lucas Wyldbore, how many of them are over 300 pages?
books have over 300 pages refers to num_pages > 300
SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore' AND T1.num_pages > 300
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
Show the number of games which were released on X360 in 2010.
on X360 refers to platform_name = 'X360'; in 2010 refers to release_year = '2010'
SELECT COUNT(DISTINCT T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'X360' AND T2.release_year = 2010
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
retails
What is the discounted price of the part "burnished seashell gainsboro navajo chocolate" in order no.1?
part "burnished seashell gainsboro navajo chocolate" refers to p_name = 'burnished seashell gainsboro navajo chocolate'; order no.1 refers to l_orderkey = 1; discounted price refers to multiply(l_extendedprice, subtract(1, l_discount))
SELECT T1.l_extendedprice * (1 - T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate' AND T1.l_orderkey = 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
soccer_2016
Which team has the highest number of losses of all time?
name of the team refers to Team_Name; the highest number of losses refers to max(add(count(Team_1 where Team_Id = Team_1 and Team_1 <> Match_Winner), count(Team_2 where Team_Id = Team_2 and Team_2 <> Match_Winner)))
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN ( SELECT COUNT(Team_1) AS a, Team_1 FROM Match WHERE Team_1 <> Match_Winner GROUP BY Team_1 UNION SELECT COUNT(Team_2) AS a, Team_2 FROM Match WHERE Team_2 <> Match_Winner GROUP BY Team_2 ORDER BY a DESC LIMIT 1 ) AS T2 ON T1.Team_Id = T2.Team_1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...
retails
What is the profit for part no.98768 in order no.1?
part no.98768 refers to l_partkey = 98768; order no.1 refers to l_orderkey = 1; profit = subtract(multiply(l_extendedprice, subtract(1, l_discount)), multiply(ps_supplycost, l_quantity))
SELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey WHERE T1.l_orderkey = 1 AND T1.l_partkey = 98768
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
books
Among the books ordered by Lucas Wyldbore, what is the percentage of those books over $13?
books over $13 refers to price > 13; percentage = Divide (Sum (order_id where price > 13), Count (order_id)) * 100
SELECT CAST(SUM(CASE WHEN T1.price > 13 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'
CREATE TABLE order_line ( book_id INTEGER references book, -- price REAL, -- line_id INTEGER primary key autoincrement, order_id INTEGER references cust_order, -- ); CREATE TABLE customer ( customer_id INTEGER primary key, first_name TEXT, -- last_name TEXT, -- email TEXT, -- ); CREATE TABLE book_...
video_games
Tell the genre of the game "Resident Evil: Revelations".
genre refers to genre_name; game "Resident Evil: Revelations" refers to game_name = 'Resident Evil: Revelations'
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Resident Evil: Revelations'
CREATE TABLE region_sales ( foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (game_platform_id) references game_platform(id), foreign key (region_id) references region(id), region_id INTEGER default NULL, -- Example Values: `1`, `...
soccer_2016
Which season played the highest number of matches at M Chinnaswamy Stadium?
season refers to Season_Id; the highest number of matches refers to max(count(Season_Id)); M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'
SELECT T1.Season_Id FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium' GROUP BY T1.Season_Id ORDER BY COUNT(T1.Season_Id) DESC LIMIT 1
CREATE TABLE Win_By ( Win_Id INTEGER primary key, Win_Type TEXT, -- Example Values: `runs`, `wickets`, `NO Result`, `Tie` | Value Statics: Total count 4 - Distinct count 4 - Null count 0 ); CREATE TABLE Wicket_Taken ( Kind_Out INTEGER, -- Example Values: `2`, `1`, `3`, `4`, `5` | Value Statics: Total count 6727 ...