db_id stringclasses 66 values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66 values |
|---|---|---|---|---|
coinmarketcap | Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price. | the highest percentage price changed in 24 hours refers to max(percent_change_24h) | SELECT T1.name, T2.DATE, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_24h = ( SELECT MAX(percent_change_24h) FROM historical ) | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
olympics | Give the height of the tallest athlete from Portugal. | the tallest athlete refers to id where MAX(height); from Portugal refers to region_name = 'Portugal'; | SELECT T3.height FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Portugal' ORDER BY T3.height DESC LIMIT 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
video_games | What is the name of the publisher that released the most video games in 2007? | name of the publisher refers to publisher_name; publisher that released the most video games in 2007 refers to MAX(COUNT(publisher_name)) WHERE release_year = 2007; | SELECT T3.publisher_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.release_year = 2007 GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | How many first teams chose to bat after winning the toss? | first teams refers to Team_1; chose to bat after winning the toss refers to Toss_Winner and Toss_Decide = 2 | SELECT COUNT(Team_1) FROM `Match` WHERE Team_1 = Toss_Winner AND Toss_Decide = 2 | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What is the maximum and minimum temperature for station number 1 on 15 January 2012? | station number 1 refers to station_nbr = 1 ; minimum temperature = tmin; maximum temperature = tmax; on 15 January 2012 refers to date = '2012-01-15' | SELECT tmax, tmin FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-15' | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Name the coin and date of transactions with the greatest decline in percent change in 1 hour. | the greatest decline in percent change in 1 hour refers to max(percent_change_1h) | SELECT T1.name, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_1h = ( SELECT MIN(percent_change_1h) FROM historical ) | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
shakespeare | How many poems did Shakespeare write? | poems refers to GenreType = 'Poem' | SELECT COUNT(id) FROM works WHERE GenreType = 'Poem' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | List the name and country of the players who got more than average catches in ascending order of the number of catches. | name and country of the players refers to Player_Name and Country_Name; catches refers to Out_name = 'caught'; average catches refers to divide(count(Player_ID) when Out_name = 'caught', sum(Player_ID)) | SELECT T1.Player_Name, T4.Country_Name FROM Player AS T1 INNER JOIN Wicket_Taken AS T2 ON T1.Player_Id = T2.Fielders INNER JOIN Out_Type AS T3 ON T2.Kind_Out = T3.Out_Id INNER JOIN Country AS T4 ON T1.Country_Name = T4.Country_Id GROUP BY T1.Player_Name ORDER BY COUNT(T3.Out_Name) ASC | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What is the minimum dew point? | minimum dew point refers to Min(dewpoint) | SELECT MIN(dewpoint) FROM weather | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What was the price of 1 Bitcoin in 2016? | 2016 refers to historical date where year(date) = 2016 | SELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' AND STRFTIME('%Y', T2.date) = '2016' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
shakespeare | What is the title of the first ever work of William Shakespeare? | first ever work refers to min(Date) | SELECT Title FROM works WHERE Date = ( SELECT MIN(Date) FROM works ) | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
sales_in_weather | How many days did the sun rise before 5 AM? | sunrise before 5 Am refers to sunrise < time ('5:00:00') | SELECT COUNT(DISTINCT `date`) AS days FROM weather WHERE sunrise < time('05:00:00') | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28? | ranked the first refers to cmc_rank = 1; on 2013/4/28 refers to date = '2013-04-28' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.cmc_rank = 1 | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | List down the platform IDs of the games with a region ID of 3. | null | SELECT T2.id FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id WHERE T1.region_id = 3 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | How many paragraphs are there in Act 5 Scene 1 of "Comedy of Errors"? | "Comedy of Errors" refers to Title = 'Comedy of Errors' | SELECT COUNT(T3.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 5 AND T2.Scene = 1 AND T1.Title = 'Comedy of Errors' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | Identify by their ID all the overs in which the player with ID 7 was on strike. | Identify by their ID all the overs refers to Over_Id; player with ID 7 was on strike refers to Striker = 7 | SELECT DISTINCT Over_Id FROM Ball_by_Ball WHERE Striker = 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | How many days did the show fell more than 5 inches? | snow fell more than 5 inches refers to snowfall > 5 | SELECT COUNT(DISTINCT `date`) FROM weather WHERE snowfall > 5 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | For all coins with average price more than $1000. State the current status of the coin. | average price more than $1000 refers to AVG(price)>1000 | SELECT T1.status FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id GROUP BY T1.name HAVING AVG(T2.price) > 1000 | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
olympics | How many 20 years old athletes were there in the 1984 Summer Olympic Games? | 20 years old athletes refer to person_id where age = 20; 1984 Summer Olympic Games refer to games_name = '1984 Summer'; | SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1984 Summer' AND T2.age = 20 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
video_games | List down the platform IDs of the games released in 2007. | released in 2007 refers to release_year = 2007; | SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2007 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | What are the character names and descriptions of characters in "Venus and Adonis"? | character names refers to CharName; "Venus and Adonis" refers to Title = 'Venus and Adonis' | SELECT DISTINCT T4.CharName, T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Venus and Adonis' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | How many players are older than Gurkeerat Singh player? | older than Gurkeerat Singh player refers to DOB ! = 'Gurkeerat Singh' and DOB < '1990-06-29' | SELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What is the maximum average speed? | maximum average speed refers to Max(avgspeed) | SELECT MAX(avgspeed) FROM weather | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22. | average percentage price changed from the previous 24 hours refers to AVG(percent_change_24h); on 15/5/2013 refers to DATE = '2013-04-15' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2020-06-22' GROUP BY T1.name HAVING AVG(T2.percent_change_24h) > T2.PRICE | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | State the name of the platforms for games released in 2000. | name of the platforms refers to platform_name; released in 2000 refers to release_year = 2000; | SELECT DISTINCT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T1.release_year = 2000 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | How many chapters include the character name "First Witch"? | character name "First Witch" refers to CharName = 'First Witch' | SELECT COUNT(T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'First Witch' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | What is the difference in the average number of players out by lbw and runout in the matches? | out by lbw refers to Out_Id = 4; runout refers to Out_Id = 3; average out by lbw refers to avg(Player_Out when Out_Id = 4); average out by runout refers to avg(Player_Out when Out_Id = 3) | SELECT AVG(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T2.Out_Name = 'lbw' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | Between the stores under weather station 12, what is the percentage of item 5 sold in store 10 in 2014? | weather station 12 refers to station_nbr = 12; item 5 refers to item_nbr = 5; 10 store refers to store_nbr = 10; in 2014 refers to SUBSTR(date, 1, 4) = '2014'; percentage = Divide (Sum(units where store_nbr = 10), Sum(units)) * 100 | SELECT CAST(SUM(CASE WHEN T2.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE station_nbr = 12 AND item_nbr = 5 AND T2.`date` LIKE '%2014%' | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
video_games | Calculate the number of game publisher IDs for games released in 1984. | released in 1984 refers to release_year = 1984; | SELECT COUNT(T.game_publisher_id) FROM game_platform AS T WHERE T.release_year = 1984 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | How many games were played in March 2010? | were played in March 2010 refers to Match_Date = '2010-03%' | SELECT SUM(CASE WHEN Match_Date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `Match` | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | Which station has the highest number of stores? Calculate the said station's average maximum temperature in February 2012. | station with highest number of stores refers to station_nbr where Max(Count(store_nbr)); station refers to station_nbr; in February 2012 refers to substring (date, 1, 7) = '2012-02'; average maximum temperature = Divide(Sum(tmax), 29) | SELECT CAST(SUM(T2.tmax) AS REAL) / 29 FROM ( SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(store_nbr) DESC LIMIT 1 ) AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE SUBSTR(T2.`date`, 1, 7) = '2012-02' | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Which crytocurrency was not opened on 2013/5/3? | not opened refers to open IS NULL; on 2013/5/3 refers to date = '2013-05-03' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-03' AND T2.open IS NULL | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
shakespeare | List the character names and descriptions of chapter ID 18710. | character names refers to CharName | SELECT DISTINCT T1.CharName, T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.Chapter_id = 18710 | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
sales_in_weather | Among the stations with 3 stores, how many stations have a station pressure of no more than 30 on February 18, 2014? | station with 3 stores refers to station_nbr where Count(store_nbr) = 3; station pressure of no more than 30 refers to stnpressure < 30; On February 18, 2014 refers to date = '2014-02-18' | SELECT COUNT(station_nbr) FROM weather WHERE `date` = '2014-02-18' AND stnpressure < 30 AND station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 3 ) | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Name the coin under the token category that gives the highest max profit. | the highest max profit refers to max(subtract(high, low)) | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.category = 'token' ORDER BY T2.high - T2.low DESC LIMIT 1 | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | How many game publisher IDs have published games on the X360 platform? | X360 refers to platform_name = 'X360'; | SELECT COUNT(T1.game_publisher_id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'X360' | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | Indicate the name of the most versatile players of the Delhi Daredevils. | if a player has multiple roles in a match, it means this player is versatile; name refers to Player_Name; most versatile player refers to MAX(COUNT(Role_id)); Delhi Daredevils refers to Team_Name = 'Delhi Daredevils' | SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T2.Team_Name = 'Delhi Daredevils' GROUP BY T3.Player_Name ORDER BY COUNT(T1.Role_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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | On February 8, 2014, what is the minimum temperature in the station where store 29 belongs? | On February 8, 2014 refers to date = '2014-02-08'; store 29 refers to store_nbr = 29; minimum temperature refers to tmin; station refers to station_nbr | SELECT tmin FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.store_nbr = 29 AND T2.`date` = '2014-02-08' | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | When did Bitcoin reach its highest price on 2013/4/29? | time that a coin reaches its highest price refers to time_high; on 2013/4/29 refers to date = '2013-04-29' | SELECT T2.time_high FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | What are the game IDs of the games published by Bethesda Softworks? | Bethesda Softworks refers to publisher_name = 'Bethesda Softworks'; | SELECT T1.game_id FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Bethesda Softworks' | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | How many chapters are there in "Midsummer Night's Dream"? | in "Midsummer Night's Dream" refers to Title = 'Midsummer Night's Dream' | SELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Midsummer Night''s Dream' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | Who got the Man of the Series Award in 2010? | player's name refers to Player_Name; got the Man of the Series Award refers to Man_of_the_Match = Player_Id; in 2010 refers to Season_Year = 2010 | SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T2.Man_of_the_Match = T1.Player_Id INNER JOIN Season AS T3 ON T3.Season_Id = T2.Season_Id WHERE T3.Season_Year = 2010 GROUP BY T1.Player_Name | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | How many stores belong to the station with the highest recorded heat of all time? | highest recorded heat refers to Max(heat); station refers to station_nbr | SELECT COUNT(T2.store_nbr) FROM ( SELECT station_nbr FROM weather ORDER BY heat DESC LIMIT 1 ) AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | How much dollars was a Bitcoin worth on 2013/4/28 according to the coin market? | worth refers to price; on 2013/4/28 refers to date = '2013-04-28' | SELECT T2.market_cap FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | What are the sales made by the games in Japan region? | sales = SUM(num_sales); Japan region refers to region_name = 'Japan'; | SELECT SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) AS nums FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | In what year did SP Narine win the Orange Cap? | year refers to Season_Year | SELECT T4.Season_Year, T4.Orange_Cap FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Season AS T4 ON T3.Season_Id = T4.Season_Id WHERE T1.Player_Name = 'SP Narine' GROUP BY T4.Season_Year, T4.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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What are the top 3 stations that have sold the highest quantities for an item in a single day? | highest quantity refers to Max(units); station refers to station_nbr | SELECT T2.station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr ORDER BY T1.units DESC LIMIT 3 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What was the price of Bitcoin when it closed at the end of the day on 2013/4/29? | price when it closed refers to close; on 2013/4/29 refers to date = '2013-04-29' | SELECT T2.close FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | List down the names of the games in the racing genre. | name of games refers to game_name; racing genre refers to genre_name = 'Racing'; | SELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Racing' | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | List down any 5 titles in the history genre. | in the history genre refers to GenreType = 'History' | SELECT Title FROM works WHERE GenreType = 'History' LIMIT 5 | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | How many times has SR Watson been named 'Man of the Match'? | null | SELECT SUM(CASE WHEN T2.Player_Name = 'SR Watson' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What are the items sold by the store during the day whose station recorded the thickest snowfall? | thickest snowfall refers to Max(snowfall); item refers to item_nbr | SELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN ( SELECT station_nbr, `date` FROM weather ORDER BY snowfall DESC LIMIT 1 ) AS T3 ON T2.station_nbr = T3.station_nbr | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What was the number of Bitcoins verifiably burned until 2013/4/28? | the number of Bitcoins verifiably burned = max_supply - total_supply; 2013/4/28 refers to date = '2013-04-28' | SELECT T2.max_supply - T2.total_supply FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | Find out the difference between the number of publishers who released the games on the PS3 and X360. | difference = SUBTRACT(SUM(platform_name = 'PS3'), SUM(platform_name = 'X360')); PS3 refers to platform_name = 'PS3'; X360 refers to platform_name = 'X360'; | SELECT COUNT(CASE WHEN T2.platform_name = 'PS3' THEN T1.game_publisher_id ELSE NULL END) - COUNT(CASE WHEN T2.platform_name = 'X360' THEN T1.game_publisher_id ELSE NULL END) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | How many scenes are there in Act 5 of work ID 9? | null | SELECT COUNT(Scene) FROM chapters WHERE work_id = 9 AND Act = 5 | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | What is the name of the player who has been chosen the most times for 'Man of the Series'? | name of the player refers to Player_Name; most times for 'Man of the Series' refers to max(count(Man_of_the_Match)) | SELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | In weather station 17, which store sold the highest quantity of item 45 in October 2012? | weather station 17 refers to station_nbr = 17; item 45 refers to item_nbr = 45; in October 2012 refers to SUBSTR(date, 1, 7) = '2012-10': highest quantity refers to Max(Sum(units)); store refers to store_nbr | SELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 45 AND T2.station_nbr = 17 AND T1.`date` LIKE '%2012-10%' GROUP BY T1.store_nbr ORDER BY SUM(T1.units) DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
soccer_2016 | List all Zimbabwean players. | Zimbabwean refers to Country_Name = 'Zimbabwea'; players refers to Player_Name | SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'Zimbabwea' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What is the earliest sunrise recorded in the stations with no more than 1 store in February 2012? | in February 2012 refers to SUBSTR(date, 1, 7) = '2012-02'; earliest sunrise Min(sunrise); station with no more than 1 store refers to station_nbr where Count(store_nbr) = 1 | SELECT T1.station_nbr FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE sunrise IS NOT NULL AND T2.`date` LIKE '%2012-02%' AND T1.station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 1 ) ORDER BY sunrise LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28. | a total amount of existence of over 10000000 refers to total_supply>10000000; on 2013/4/28 refers to date = '2013-04-28' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.total_supply > 10000000 | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | What is the genre of the game "Grand Theft Auto V"? | genre refers to genre_name; "Grand Theft Auto V" refers to game_name = 'Grand Theft Auto V'; | SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Grand Theft Auto V' | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | What is the paragraph number with plain text "This is Illyria, lady"? | paragraph number refers to ParagraphNum | SELECT ParagraphNum FROM paragraphs WHERE PlainText = 'This is Illyria, lady.' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
sales_in_weather | Which station sold the highest quantity of item number 5 overall? | item number 5 refers to item_nbr = 5; sold highest quantity refers to Max(Sum(units)); station refers to station_nbr | SELECT T2.station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 5 GROUP BY T2.station_nbr ORDER BY SUM(T1.units) DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What was the max profit a user can make on Bitcoin on 2013/4/28? | the max profit = subtract(high, low); on 2013/4/28 refers to date = '2013-04-28' | SELECT T2.high - T2.low FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
soccer_2016 | List the match IDs which had players out by hit wickets. | had players out by hit wickets refers to Out_Name = 'hit wicket' | SELECT T1.Match_Id FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'hit wicket' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | What is the most purchased products during the rainy days in June 2013 in weather station 9? | most purchased product refers to Max(units); during the rainy day refers to codesum = RA; in June 2013 refers to SUBSTR(date, 1, 7) = '2013-06'; weather station 9 refers to station_nbr = 9; product refers to item_nbr | SELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T3.station_nbr = 9 AND T1.`date` LIKE '%2013-06%' AND codesum = 'RA' ORDER BY T1.units DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Which crytocurrency was traded in the highest value on 2016/1/8? | traded in the highest value refers to max(volume_24h); on 2016/1/8 refers to date = '2016-01-08' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2016-01-08' AND T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical WHERE date = '2016-01-08' ) | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | What are the top 2 platforms with the most sales in North America? | platforms refers to platform_name; most sales refers to MAX(num_sales); North America refers to region_name = 'North America'; | SELECT T4.platform_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 platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'North America' ORDER BY T2.num_sales DESC LIMIT 2 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | How many games were not won by runs? | not won by runs refers to Win_Type ! = 'runs' | SELECT SUM(CASE WHEN T2.Win_Type != 'runs' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | Among the stores in weather station 14 in February 2014, which store had sold no less than 300 quantities for item number 44 in a single day? | weather station 14 refers to station_nbr = 14; February 2014 refers to substring (date, 1, 7) = '2014-02' ; sold no less than 300 quantities refers to units > = 300; item no.44 refers to item_nbr = 44; store refers to store_nbr | SELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T2.station_nbr = 14 AND T1.`date` LIKE '%2014-02%' AND T1.item_nbr = 44 AND units >= 300 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Which crytocurrency had a bigger number of coins circulating in the market and in the general public's hands on 2013/4/28, Bitcoin or Litecoin? | a bigger number of coins circulating in the market refers to max(circulating_supply); on 2013/4/28 refers to date = '2013-04-28' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name IN ('Bitcoin', 'Litecoin') ORDER BY T2.circulating_supply DESC LIMIT 1 | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | What are the genres of games published by the publisher with an ID of 464? | genres of games refers to genre_name; publisher with an ID of 464 refers to publisher_id = 464; | SELECT DISTINCT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id INNER JOIN game_publisher AS T3 ON T1.id = T3.game_id WHERE T3.publisher_id = 464 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | On average, how many scenes are there in each of the comedy works written by Shakespeare? | comedy refers to GenreType = 'Comedy'; average = divide(sum(count(Scene)), count(work.id)) | SELECT CAST(SUM(T2.Scene) AS REAL) / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'Comedy' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
sales_in_weather | How many stores belong to the most windy station? | most windy station refers to Max(avgspeed) | SELECT COUNT(store_nbr) FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY avgspeed DESC LIMIT 1 ) | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
shakespeare | Between Rome and Juliet, which character was mentioned the most in the The Tragedy of Romeo and Juliet? Calculate for Romeo and Juliet's individual amount of appearance in percentage against the overall number of characters that appeared in the said work. | Rome and Juliet refers to CharName = 'Romeo' and CharName = 'Juliet'; The Tragedy of Romeo and Juliet refers to LongTitle = 'The Tragedy of Romeo and Juliet'; percentage = divide(sum(charater.id) when CharName = 'Romeo', sum(charater.id)) as percentage and percentage = divide(sum(charater.id) when CharName = 'Juliet', count(charater.id)) as percentage | SELECT SUM(IIF(T4.CharName = 'Romeo', 1, 0)), SUM(IIF(T4.CharName = 'Juliet', 1, 0)), CAST(SUM(IIF(T4.CharName = 'Romeo', 1, 0)) + SUM(IIF(T4.CharName = 'Juliet', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | Which teams have had a player awarded the Purple Cap and another with the Orange Cap in the same season? | null | SELECT T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Season_Id = T2.Season_Id INNER JOIN Player_Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Player AS T4 ON T3.Player_Id = T4.Player_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id GROUP BY T5.Team_Name, T1.Orange_Cap, T1.Purple_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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | Which weather station does the store that sold the highest quantity of item 9 belongs to? | item 9 refers to item_nbr = 9; sold the highest quantity refers to Max(Sum(units)); weather station refers to station_nbr | SELECT station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 9 GROUP BY T2.station_nbr ORDER BY SUM(T1.units) DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What was the percentage of the Bitcoins verifiably burned until 2018/4/28? | the percentage of the Bitcoins verifiably burned = divide(subtract(SUM(max_supply), SUM(total_supply)),SUM(total_supply))*100%; until 2013/4/28 refers to date<'2013-04-08' | SELECT CAST((SUM(T2.max_supply) - SUM(T2.total_supply)) AS REAL) / SUM(T2.total_supply) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date < '2018-04-28' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
olympics | How many people have won the gold medal of the event "Rowing Women's Coxed Eights"? | won the gold medal refers to medal_name = 'Gold'; event "Rowing Women's Coxed Eights" refers to event_name = 'Rowing Women''s Coxed Eights'; | SELECT COUNT(T1.competitor_id) FROM competitor_event AS T1 INNER JOIN event AS T2 ON T1.event_id = T2.id INNER JOIN medal AS T3 ON T1.medal_id = T3.id WHERE T2.event_name LIKE 'Rowing Women%s Coxed Eights' AND T3.medal_name = 'Gold' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
video_games | Calculate the total number of IDs for the game published by Capcom and Sony Computer Entertainment. | Capcom refers to publisher_name = 'Capcom'; Sony Computer Entertainment refers to publisher_name = 'Sony Computer Entertainment'; | SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name IN ('Capcom', 'Sony Computer Entertainment') | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | In "A Lover's Complaint", what is the description of Act 1, Scene 1? | "A Lover's Complaint" refers to Title = 'A Lover''s Complaint' | SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'A Lover''s Complaint' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
sales_in_weather | In March 2014, which weather stations recorded the highest number of days whose temperature is below the 30-year normal? | in March 2014 refers to substring (date, 1, 4) = '2014' and substring (date, 6, 2) = '03'; temperature is below the 30-year normal refers to depart < 0; highest number of days refers to Max(Count(date)) | SELECT station_nbr FROM weather WHERE SUBSTR(`date`, 1, 4) = '2014' AND SUBSTR(`date`, 6, 2) = '03' AND depart < 0 GROUP BY station_nbr HAVING COUNT(DISTINCT `date`) = ( SELECT COUNT(DISTINCT `date`) FROM weather WHERE SUBSTR(`date`, 1, 4) = '2014' AND SUBSTR(`date`, 6, 2) = '03' AND depart < 0 GROUP BY station_nbr ORDER BY COUNT(`date`) DESC LIMIT 1 ) | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | Had Bitcoin's price increased or decreased on 2013/5/5 compared with the price 7 days before? | price increased refers to percent_change_7d>0; decreased refers percent_change_7d<0; on 2013/5/5 refers to date = '2013-05-05' | SELECT (CASE WHEN T2.percent_change_7d > 0 THEN 'INCREASED' ELSE 'DECREASED' END) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-05' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | Calculate the total sales made by the games released in 2000. | total sales = SUM(num_sales); released in 2000 refers to release_year = 2000; | SELECT SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id WHERE T2.release_year = 2000 | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | In which country do most players have the 'slow left-arm chinaman' bowling style? | 'slow left-arm chinaman' bowling style refers to Bowling_skill = 'Slow left-arm chinaman'; most players refers to max(count(Country_Id)) | SELECT T3.Country_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Bowling_skill = 'Slow left-arm chinaman' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | Which weather station has the highest number of stores? | number of store refers to store_nbr; highest number of store refers to Max(Count(store_nbr)); weather station refers to station_nbr | SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(store_nbr) DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What was the average price of a Bitcoin in the year 2013? | average price refers SUM(price)/COUNT(named = 'Bitcoin'); in the year 2013 refers to year(date) = 2013 | SELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y', T2.date) = '2013' AND T1.name = 'Bitcoin' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
shakespeare | When did Shakespeare create his work that has 154 scenes? | When refers to Date; has 154 scenes refers to count(Scene) = 154 | SELECT T1.Date, T1.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Scene = 154 | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | How many players bat with their left hands? | bat with their left hands refers to Batting_hand = 'Left-hand bat' | SELECT SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | Between 1/1/2012 to 12/31/2014, which date recorded the hottest temperature in weather station 1? | weather station 1 refers to station_nbr = 1; hottest temperature refers to Max(tmax); between 1/1/2012 to 12/31/2014 refers to SUBSTR(date, 1, 4) between 2012 and 2014 | SELECT `date` FROM weather WHERE station_nbr = 1 AND CAST(SUBSTR(`date`, 1, 4) AS int) BETWEEN 2012 AND 2014 ORDER BY tmax DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
food_inspection_2 | What is the restaurant's name at "41.9532864854" latitude and "-87.7673790701422" longitude? | restaurant refers to facility_type = 'Restaurant'; name refers to dba_name; "41.9532864854" latitude and "-87.7673790701422" longitude refers to latitude = 41.9532864854 and longitude = -87.7673790701422 | SELECT dba_name FROM establishment WHERE latitude = 41.9532864854 AND longitude = -87.7673790701422 AND facility_type = 'Restaurant' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER primary key,
results TEXT, -- Example Values: `Pass`, `Pass w/ Conditions`, `Fail`, `Out of Business`, `Business Not Located` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
inspection_date DATE, --
inspection_type TEXT, --
);
CREATE TABLE violation
(
inspector_comment TEXT, --
inspection_id INTEGER, --
foreign key (inspection_id) references inspection(inspection_id),
point_id INTEGER, --
primary key (inspection_id, point_id),
foreign key (point_id) references inspection_point(point_id),
foreign key (point_id) references inspection_point(point_id),
fine INTEGER, -- Example Values: `100`, `0`, `500`, `250` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE establishment
(
facility_type TEXT, --
address TEXT, --
risk_level INTEGER, -- Example Values: `2`, `1`, `3` | Value Statics: Total count 31621 - Distinct count 3 - Null count 21
aka_name TEXT, --
state TEXT, -- Example Values: `IL` | Value Statics: Total count 31640 - Distinct count 1 - Null count 2
zip INTEGER, --
license_no INTEGER primary key,
city TEXT, -- Example Values: `CHICAGO`, `Chicago`, `chicago`, `CHicago`, `MAYWOOD` | Value Statics: Total count 31593 - Distinct count 16 - Null count 49
ward INTEGER, --
longitude REAL, --
latitude REAL, --
dba_name TEXT, --
);
CREATE TABLE employee
(
zip INTEGER, --
city TEXT, -- Example Values: `Chicago`, `Park Forest`, `Hoffman Estates` | Value Statics: Total count 75 - Distinct count 3 - Null count 0
phone TEXT, --
employee_id INTEGER primary key,
title TEXT, -- Example Values: `Sanitarian`, `Supervisor`, `Division Manager` | Value Statics: Total count 75 - Distinct count 3 - Null count 0
first_name TEXT, --
salary INTEGER, --
address TEXT, --
supervisor INTEGER, -- Example Values: `177316`, `186742`, `179582`, `182205`, `192462` | Value Statics: Total count 75 - Distinct count 8 - Null count 0
state TEXT, -- Example Values: `IL` | Value Statics: Total count 75 - Distinct count 1 - Null count 0
last_name TEXT, --
foreign key (supervisor) references employee(employee_id),
);
CREATE TABLE inspection_point
(
point_id INTEGER primary key,
category TEXT, -- Example Values: `Food Protection`, `Food Equipment and Utensil Sanitation`, `Wash and Waste Water Disposal`, `Toilet and Hand Washing Facilities for Staff`, `Compliance Insect and Rodent Control` | Value Statics: Total count 46 - Distinct count 14 - Null count 0
Description TEXT, --
fine INTEGER, -- Example Values: `500`, `250`, `100` | Value Statics: Total count 46 - Distinct count 3 - Null count 0
point_level TEXT, -- Example Values: `Critical`, `Serious `, `Minor ` | Value Statics: Total count 46 - Distinct count 3 - Null count 0
code TEXT, -- Example Values: `7-38-005 (B) (B-2)`, `7-38-005 (A)`, `7-38-010 (A) (B)`, `7-38-030`, `7-38-031` | Value Statics: Total count 46 - Distinct count 17 - Null count 0
); |
shakespeare | How many number of paragraphs are there in chapter ID 18881? | number of paragraphs refers to ParagraphNum | SELECT COUNT(ParagraphNum) FROM paragraphs WHERE chapter_id = 18881 | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
sales_in_weather | How many items weren't sold in store 2 on 1/1/2012? | store no.2 refers to store_nbr = 2; item weren't sold refers to units = 0; on 1/1/2012 refers to date = '2012-01-01' | SELECT COUNT(item_nbr) FROM sales_in_weather WHERE store_nbr = 2 AND units = 0 AND `date` = '2012-01-01' | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
video_games | Calculate the number of games in the fighting genre. | fighting genre refers to genre_name = 'Fighting'; | SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting' | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
soccer_2016 | List the name of all New Zealand umpires. | New Zealand umpires refers to Country_Name = 'New Zealand'; name of umpires refers to Umpire_Name | SELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
sales_in_weather | How many stores are in weather station 12? | weather station 12 refers to station_nbr = 12; number of stores refers to Count(store_nbr) | SELECT SUM(store_nbr) FROM relation WHERE station_nbr = 12 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreign key (station_nbr) references weather(station_nbr),
);
CREATE TABLE weather
(
resultdir INTEGER, --
date DATE, --
codesum TEXT, --
dewpoint INTEGER, --
primary key (station_nbr, date),
avgspeed REAL, --
heat INTEGER, --
depart INTEGER, --
resultspeed REAL, --
tmin INTEGER, --
tmax INTEGER, --
sunset TEXT, --
wetbulb INTEGER, --
station_nbr INTEGER, --
tavg INTEGER, --
stnpressure REAL, --
sunrise TEXT, --
cool INTEGER, --
sealevel REAL, --
preciptotal REAL, --
snowfall REAL, --
); |
coinmarketcap | What's the descripition of BitBar? | null | SELECT description FROM coins WHERE name = 'BitBar' | CREATE TABLE historical
(
total_supply REAL, --
high REAL, --
percent_change_7d REAL, --
open REAL, --
close REAL, --
percent_change_1h REAL, --
percent_change_24h REAL, --
num_market_pairs INTEGER, --
time_low TEXT, --
coin_id INTEGER, --
date DATE, --
time_high TEXT, --
market_cap REAL, --
low REAL, --
circulating_supply REAL, --
cmc_rank INTEGER, --
price REAL, --
volume_24h REAL, --
max_supply REAL, --
);
CREATE TABLE coins
(
tags TEXT, --
notice TEXT, --
category TEXT, -- Example Values: `coin`, `token` | Value Statics: Total count 8869 - Distinct count 2 - Null count 58
date_added TEXT, --
date_launched TEXT, --
name TEXT, --
id INTEGER not null primary key,
description TEXT, --
slug TEXT, --
platform_id INTEGER, --
website TEXT, --
tag_names TEXT, --
symbol TEXT, --
status TEXT, -- Example Values: `active`, `untracked`, `inactive`, `extinct` | Value Statics: Total count 8927 - Distinct count 4 - Null count 0
subreddit TEXT, --
); |
video_games | Find out the platform of the game "Final Fantasy XIII-2". | platform of the game refers to platform_name; "Final Fantasy XIII-2" refers to game_name = 'Final Fantasy XIII-2'; | 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 = 'Final Fantasy XIII-2' | 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`, `2`, `3`, `4` | Value Statics: Total count 65320 - Distinct count 4 - Null count 0
num_sales REAL default NULL, --
game_platform_id INTEGER default NULL, --
);
CREATE TABLE genre
(
id INTEGER not null primary key,
genre_name TEXT default NULL, -- Example Values: `Action`, `Adventure`, `Fighting`, `Misc`, `Platform` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE region
(
id INTEGER not null primary key,
region_name TEXT default NULL, -- Example Values: `North America`, `Europe`, `Japan`, `Other` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE game
(
foreign key (genre_id) references genre(id),
game_name TEXT default NULL, --
id INTEGER not null primary key,
genre_id INTEGER default NULL, -- Example Values: `4`, `5`, `11`, `2`, `9` | Value Statics: Total count 11317 - Distinct count 12 - Null count 0
);
CREATE TABLE publisher
(
id INTEGER not null primary key,
publisher_name TEXT default NULL, --
);
CREATE TABLE game_platform
(
platform_id INTEGER default NULL, --
game_publisher_id INTEGER default NULL, --
foreign key (platform_id) references platform(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
foreign key (game_publisher_id) references game_publisher(id),
id INTEGER not null primary key,
release_year INTEGER default NULL, --
);
CREATE TABLE game_publisher
(
publisher_id INTEGER default NULL, --
game_id INTEGER default NULL, --
id INTEGER not null primary key,
foreign key (game_id) references game(id),
foreign key (publisher_id) references publisher(id),
);
CREATE TABLE platform
(
id INTEGER not null primary key,
platform_name TEXT default NULL, --
); |
shakespeare | How many paragraphs are there in the longest chapter where Sir Richard Ratcliff appeared? | longest chapter refers to max(ParagraphNum); Sir Richard Ratcliff refers to CharName = 'Sir Richard Ratcliff' | SELECT MAX(T2.ParagraphNum) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Richard Ratcliff' | CREATE TABLE characters
(
CharName TEXT not null, --
Abbrev TEXT not null, --
Description TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE paragraphs
(
chapter_id INTEGER default 0 not null references chapters, --
character_id INTEGER not null references characters, --
ParagraphNum INTEGER not null, --
PlainText TEXT not null, --
id INTEGER primary key autoincrement,
);
CREATE TABLE works
(
GenreType TEXT not null, -- Example Values: `Comedy`, `Tragedy`, `History`, `Poem`, `Sonnet` | Value Statics: Total count 43 - Distinct count 5 - Null count 0
Title TEXT not null, --
Date INTEGER not null, --
id INTEGER primary key autoincrement,
LongTitle TEXT not null, --
);
CREATE TABLE chapters
(
work_id INTEGER not null references works, --
Act INTEGER not null, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 945 - Distinct count 6 - Null count 0
Description TEXT not null, --
id INTEGER primary key autoincrement,
Scene INTEGER not null, --
); |
soccer_2016 | In how many games in which the batting team was the Delhi Daredevils were no runs scored? | batting team was the Delhi Daredevils refers to Team_Name = 'Delhi Daredevils' and Team_1 = Team_Id where Team_Batting = 1 or Team_2 = Team_Id where Team_Batting = 2; no runs scored refers to Runs_Scored = 0 | SELECT COUNT(T1.Runs_Scored) FROM Batsman_Scored AS T1 INNER JOIN Ball_by_Ball AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Team AS T4 ON T3.Team_1 = T4.Team_Id WHERE T2.Team_Batting = 1 OR T2.Team_Batting = 2 AND T4.Team_Name = 'Delhi Daredevils' | 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 - Distinct count 9 - Null count 0
Player_Out INTEGER, --
foreign key (Player_Out) references Player(Player_Id),
Over_Id INTEGER, --
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Fielders INTEGER, --
foreign key (Match_Id) references Match(Match_Id),
Ball_Id INTEGER, -- Example Values: `1`, `2`, `5`, `8`, `6` | Value Statics: Total count 6727 - Distinct count 9 - Null count 0
foreign key (Kind_Out) references Out_Type(Out_Id),
foreign key (Fielders) references Player(Player_Id),
Innings_No INTEGER, -- Example Values: `2`, `1`, `3`, `4` | Value Statics: Total count 6727 - Distinct count 4 - Null count 0
Match_Id INTEGER, --
);
CREATE TABLE Toss_Decision
(
Toss_Id INTEGER primary key,
Toss_Name TEXT, -- Example Values: `field`, `bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Player_Match
(
foreign key (Role_Id) references Rolee(Role_Id),
Player_Id INTEGER, --
foreign key (Team_Id) references Team(Team_Id),
foreign key (Match_Id) references Match(Match_Id),
Role_Id INTEGER, -- Example Values: `1`, `3`, `2`, `4` | Value Statics: Total count 12694 - Distinct count 4 - Null count 0
Team_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 12694 - Distinct count 13 - Null count 0
Match_Id INTEGER, --
foreign key (Player_Id) references Player(Player_Id),
primary key (Match_Id, Player_Id, Role_Id),
);
CREATE TABLE Season
(
Orange_Cap INTEGER, -- Example Values: `100`, `18`, `133`, `162`, `19` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Man_of_the_Series INTEGER, -- Example Values: `32`, `53`, `133`, `162`, `315` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
Season_Id INTEGER primary key,
Season_Year INTEGER, -- Example Values: `2008`, `2009`, `2010`, `2011`, `2012` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
Purple_Cap INTEGER, -- Example Values: `102`, `61`, `131`, `194`, `190` | Value Statics: Total count 9 - Distinct count 8 - Null count 0
);
CREATE TABLE Batting_Style
(
Batting_Id INTEGER primary key,
Batting_hand TEXT, -- Example Values: `Left-hand bat`, `Right-hand bat` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
);
CREATE TABLE Ball_by_Ball
(
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Bowler INTEGER, --
Match_Id INTEGER, --
Striker INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Non_Striker INTEGER, --
Team_Bowling INTEGER, -- Example Values: `2`, `1`, `4`, `3`, `6` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Striker_Batting_Position INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
Team_Batting INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 11 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
Over_Id INTEGER, --
);
CREATE TABLE Rolee
(
Role_Desc TEXT, -- Example Values: `Captain`, `Keeper`, `Player`, `CaptainKeeper` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
Role_Id INTEGER primary key,
);
CREATE TABLE Umpire
(
Umpire_Name TEXT, --
Umpire_Country INTEGER, -- Example Values: `6`, `10`, `4`, `2`, `5` | Value Statics: Total count 52 - Distinct count 9 - Null count 0
Umpire_Id INTEGER primary key,
foreign key (Umpire_Country) references Country(Country_Id),
foreign key (Umpire_Country) references Country(Country_Id),
);
CREATE TABLE Country
(
Country_Id INTEGER primary key,
foreign key (Country_Id) references Country(Country_Id),
Country_Name TEXT, -- Example Values: `India`, `South Africa`, `U.A.E`, `New Zealand`, `Australia` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
);
CREATE TABLE Batsman_Scored
(
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 100000 - Distinct count 9 - Null count 0
Match_Id INTEGER, --
Runs_Scored INTEGER, -- Example Values: `0`, `1`, `4`, `6`, `2` | Value Statics: Total count 100000 - Distinct count 7 - Null count 0
foreign key (Match_Id) references Match(Match_Id),
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Over_Id INTEGER, --
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
);
CREATE TABLE Team
(
Team_Id INTEGER primary key,
Team_Name TEXT, -- Example Values: `Kolkata Knight Riders`, `Royal Challengers Bangalore`, `Chennai Super Kings`, `Kings XI Punjab`, `Rajasthan Royals` | Value Statics: Total count 13 - Distinct count 13 - Null count 0
);
CREATE TABLE City
(
Country_id INTEGER, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 29 - Distinct count 3 - Null count 0
City_Name TEXT, --
City_Id INTEGER primary key,
);
CREATE TABLE Outcome
(
Outcome_Type TEXT, -- Example Values: `Result`, `No Result`, `Superover` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Outcome_Id INTEGER primary key,
);
CREATE TABLE Player
(
Player_Id INTEGER primary key,
Player_Name TEXT, --
foreign key (Country_Name) references Country(Country_Id),
foreign key (Bowling_skill) references Bowling_Style(Bowling_Id),
Batting_hand INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 469 - Distinct count 2 - Null count 0
Country_Name INTEGER, -- Example Values: `1`, `4`, `5`, `6`, `2` | Value Statics: Total count 469 - Distinct count 11 - Null count 0
Bowling_skill INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 426 - Distinct count 14 - Null count 43
foreign key (Batting_hand) references Batting_Style(Batting_Id),
DOB DATE, --
);
CREATE TABLE Venue
(
Venue_Name TEXT, --
Venue_Id INTEGER primary key,
foreign key (City_Id) references City(City_Id),
City_Id INTEGER, --
);
CREATE TABLE Extra_Type
(
Extra_Name TEXT, -- Example Values: `legbyes`, `wides`, `byes`, `noballs`, `penalty` | Value Statics: Total count 5 - Distinct count 5 - Null count 0
Extra_Id INTEGER primary key,
);
CREATE TABLE Out_Type
(
Out_Id INTEGER primary key,
Out_Name TEXT, -- Example Values: `caught`, `bowled`, `run out`, `lbw`, `retired hurt` | Value Statics: Total count 9 - Distinct count 9 - Null count 0
);
CREATE TABLE Match
(
Win_Margin INTEGER, --
foreign key (Toss_Winner) references Team(Team_Id),
foreign key (Win_Type) references Win_By(Win_Id),
foreign key (Team_2) references Team(Team_Id),
foreign key (Toss_Decide) references Toss_Decision(Toss_Id),
foreign key (Team_1) references Team(Team_Id),
Venue_Id INTEGER, --
foreign key (Venue_Id) references Venue(Venue_Id),
Match_Id INTEGER primary key,
Match_Winner INTEGER, -- Example Values: `1`, `3`, `6`, `2`, `5` | Value Statics: Total count 574 - Distinct count 13 - Null count 3
Team_1 INTEGER, -- Example Values: `2`, `4`, `6`, `7`, `1` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
Match_Date DATE, --
Toss_Decide INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 577 - Distinct count 2 - Null count 0
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Outcome_type) references Out_Type(Out_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
foreign key (Man_of_the_Match) references Player(Player_Id),
Season_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 577 - Distinct count 9 - Null count 0
Outcome_type INTEGER, -- Example Values: `1`, `3`, `2` | Value Statics: Total count 577 - Distinct count 3 - Null count 0
Team_2 INTEGER, -- Example Values: `1`, `3`, `5`, `2`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Match_Winner) references Team(Team_Id),
foreign key (Match_Winner) references Team(Team_Id),
Win_Type INTEGER, -- Example Values: `1`, `2`, `4`, `3` | Value Statics: Total count 577 - Distinct count 4 - Null count 0
Man_of_the_Match INTEGER, --
Toss_Winner INTEGER, -- Example Values: `2`, `3`, `5`, `7`, `8` | Value Statics: Total count 577 - Distinct count 13 - Null count 0
foreign key (Season_Id) references Season(Season_Id),
);
CREATE TABLE Extra_Runs
(
Extra_Runs INTEGER, -- Example Values: `1`, `4`, `5`, `2`, `3` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
Match_Id INTEGER, --
Ball_Id INTEGER, -- Example Values: `1`, `2`, `3`, `7`, `5` | Value Statics: Total count 7469 - Distinct count 9 - Null count 0
primary key (Match_Id, Over_Id, Ball_Id, Innings_No),
Extra_Type_Id INTEGER, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 7469 - Distinct count 5 - Null count 0
foreign key (Extra_Type_Id) references Extra_Type(Extra_Id),
Innings_No INTEGER, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 7469 - Distinct count 4 - Null count 0
Over_Id INTEGER, --
);
CREATE TABLE Bowling_Style
(
Bowling_skill TEXT, -- Example Values: `Right-arm medium`, `Right-arm offbreak`, `Right-arm fast-medium`, `Legbreak googly`, `Right-arm medium-fast` | Value Statics: Total count 14 - Distinct count 14 - Null count 0
Bowling_Id INTEGER primary key,
); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.