db_id stringclasses 66 values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66 values |
|---|---|---|---|---|
sales_in_weather | What is the item number of the product with the highest number of units sold in store number 1 on 1/1/2012? | item number refers to item_nbr; highest number of units sold refers to Max(units); store no.1 refers to store_nbr = 1; on 1/1/2012 refers to date = '2012-01-01' | SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY 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 | How much was a Bitcoin on 2013/4/28? | how much refers to price; on 2013/4/28 refers to date = '2013-04-28' | SELECT T2.price 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 platform IDs of records released in 2006? | released in 1990 refers to release_year = 1990; 2000 refers to release_year = 2000; | SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2006 | CREATE TABLE region_sales
(
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (region_id) references region(id),
region_id INTEGER default NULL, -- Example Values: `1`, `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 players got out by being stumped in the second innings of all matches? | got out by being stumped refers to Out_Name = 'stumped'; the second innings refers to Innings_No = 2 | SELECT SUM(CASE WHEN T1.Innings_No = 2 THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'stumped' | 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 | For the weather station has store no.9, what was the increased percentage of the average temperature from 2012/2/2 to 2012/2/3? | store no.9 refers to store_nbr = 9; 2012/2/2 refers to date = '2012-02-02'; 2012/2/3 refers to date = '2012-02-03'; average temperature refers to tavg; increase percentage = Divide (Subtract (tavg where date = '2012-02-03', tavg where date = '2012-02-02'), tavg where date = '2012-02-02') * 100 | SELECT CAST((SUM(CASE WHEN T1.`date` = '2012-02-03' THEN T1.tavg * 1 ELSE 0 END) - SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 9 | 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 | List the names and symbols of the coins that were added on June 14, 2013. | added on June 14, 2013 refers to date_added like '2013-06-14%' | SELECT name, symbol FROM coins WHERE date_added LIKE '2013-06-14%' | 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 | Who is the character that said "This is Illyria, lady."? | character refers to CharName; "This is Illyria, lady." refers to PlainText = 'This is Illyria, lady.' | SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.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 | What percentage was the total unit sales of store no.10 to the total sales of its weather station on 2014/10/31? | store no.10 refers to store_nbr = 10; on 2014/10/31 refers to date = '2014-10-31'; 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 sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.`date` = '2014-10-31' | 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 coins that has been disappeared. | has disappeared refers to status = 'extinct' | SELECT name FROM coins WHERE status = 'extinct' | 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 | Tell the host city of the 1968 Winter Olympic Games. | host city refers to city_name; the 1968 Winter Olympic Games refer to games_name = '1968 Winter'; | SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1968 Winter' | 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 | Which year has the most number of video game releases? | year that has the most number of video game releases refers to MAX(COUNT(release_year)); | SELECT T1.release_year FROM ( SELECT T.release_year, COUNT(id) FROM game_platform AS T GROUP BY T.release_year ORDER BY COUNT(T.id) DESC LIMIT 1 ) T1 | 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 the year 1500s, how many tragedies did Shakespeare write? | year 1500s refers to Date between 1500 and 1599; tragedies refers to GenreType = 'Tragedy' | SELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy' AND Date BETWEEN 1500 AND 1599 | 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 | Give the station pressure status recorded by the weather station which contained no.12 store on 2012/5/15. | no.12 store refers to store_nbr = 12; on 2012/5/15 refers to date = '2012-05-15'; station pressure status refers to stnpressure | SELECT T1.stnpressure FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2012-05-15' AND T2.store_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 | Name the coins that have three tags. | have three tags refers to length(tag_names)-length(replace(tag_names,',','')) = 2 | SELECT name FROM coins WHERE LENGTH(tag_names) - LENGTH(replace(tag_names, ',', '')) = 2 | 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, --
); |
sales_in_weather | How many inches of total precipitation was recorded by the weather station of store no.2 on 2012/12/25? | store no.2 refers to store_nbr = 2; on 2012/12/25 refers to date = '2012-12-25'; total precipitation refers to preciptotal | SELECT T1.preciptotal FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2012-12-25' AND T2.store_nbr = 2 | 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 many coins were added in May 2013? Please list the names of coins. | in May 2013 refers to year(date_added) = 2013 and month(date_added) = 5 | SELECT COUNT(id) num FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05' UNION ALL SELECT name FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05' | 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 | In which year did the record ID 19 with game publisher ID 6657 released? | which year refers to release_year; record ID 19 refers to game platform.id; id = 19 | SELECT T.release_year FROM game_platform AS T WHERE T.game_publisher_id = 6657 AND T.id = 19 | 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 work numbers that are related to King Henry? | work numbers refers to works.id; related to King Henry refers to Title = '%Henry%' | SELECT id FROM works WHERE Title LIKE '%Henry%' | 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 player's ID of the top five players, by descending order, in terms of bowling skill. | player's ID refers to Player_Id | SELECT Player_Id FROM Player ORDER BY Bowling_skill DESC LIMIT 5 | 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 | Show the sea level status recorded by the weather station of store no.19 on 2013/2/24. | store no.19 refers to store_nbr = 19; on 2013/2/24 refers to date = '2013-02-24'; sea level status refers to sealevel | SELECT T1.sealevel FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2013-02-24' AND T2.store_nbr = 19 | 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 name the coin that ranked first among the coins traded on April 29, 2013. | ranked first refers to cmc_rank = 1; on April 29, 2013 refers to date = '2013-04-29' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' 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 | Calculate the difference in sales between the games released in 1990 and 2000. | difference = SUBTRACT(SUM(num_sales WHERE release_year = 2000), SUM(num_sales WHERE release_year = 1990)); | SELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_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, --
); |
soccer_2016 | In which venue did Kochi Tuskers Kerala play most of their matches? | Kochi Tuskers Kerala refers to Team_Name = 'Kochi Tuskers Kerala'; most of their matches refers to max(Venue_Id) | SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN Team AS T3 ON T2.Team_1 = T3.Team_Id WHERE T3.Team_Name = 'Kochi Tuskers Kerala' GROUP BY T1.Venue_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 | Provide the code summarization for the weather recorded by the weather station which contained the no.2 store on 2013/2/12. | no.2 store refers to store_nbr = 2; on 2013/2/12 refers to date = '2013-02-12'; code summarization refers to codesum | SELECT T1.codesum FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2013-02-12' AND T2.store_nbr = 2 | 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 | List the names of coins that cannot be traded in 2014. | cannot be tracked refers to status = 'untracked'; in 2014 refers to year(date_added) = '2014' | SELECT name FROM coins WHERE date_added LIKE '2014%' AND status = 'untracked' | 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 | What is the average number of extra runs made as noballs? | noballs refers to Extra_Name = 'noballs' ; average number = divide(sum(Extra_Runs), count(Extra_Runs)) | SELECT AVG(T1.Extra_Runs) FROM Extra_Runs AS T1 INNER JOIN Extra_Type AS T2 ON T1.Extra_Type_Id = T2.Extra_Id WHERE T2.Extra_Name = 'noballs' | 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 | State the number of stores that belongs to the weather station which recorded the deepest snowfall. | deepest snowfall refers to Max(snowfall); number of stores refers to store_nbr | SELECT T2.store_nbr FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr ORDER BY snowfall 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 is the name of the coin with the highest price? | the highest price refers to max(price) | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.price = ( SELECT MAX(price) 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, --
); |
video_games | Compute the average number of sales in region ID 3. | average = AVG(MULTIPLY(num_sales, 100000)); | SELECT AVG(T.num_sales * 100000) FROM region_sales AS T WHERE T.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 | In the Venus and Adonis, what is the description of the last scene listed? | Venus and Adonis refers to Title = 'Venus and Adonis'; last scene refers to max(Scene) | SELECT T2.Description FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Venus and Adonis' ORDER BY T2.Scene DESC LIMIT 1 | 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 | Provide the sunrise time recorded by the home weather station of store no.30 on 2014/2/21. | store no. 30 refers to store_nbr = 30; on 2014/2/21 refers to date = '2014-02-21' | SELECT T1.sunrise FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2014-02-21' AND store_nbr = 30 | 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 is the name of the coin that creates the most total value in the past 24 hours? | creates the most total value in the past 24 hours refers to max(volume_24h) | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.volume_24h = ( SELECT MAX(volume_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 | How many kinds of events belong to the sport of cycling? | kinds of events refer to event_name; sport of cycling refers to sport_name = 'Cycling'; | SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Cycling' | 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 | Give the game name of the game ID 44. | null | SELECT T.game_name FROM game AS T WHERE T.id = 44 | 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 long title of the Shakespeare's work with Act 4 Scene 5 described as "Mytilene. A street before the brothel."? | described as "Mytilene. A street before the brothel." refers to chapters.Description = 'Mytilene. A street before the brothel.' | SELECT T1.LongTitle FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'Mytilene. A street before the brothel.' | 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 youngest player? | name refers to Player_Name; youngest player refers to max(DOB) | SELECT Player_Name FROM Player ORDER BY DOB 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 | State the max temperature of the weather station which has the no.21 store on 2012/11/9. | no.21 store refers to store_nbr = 21; on 2012/11/9 refers to date = '2012-11-09'; max temperature refers to tmax | SELECT tmax FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 21 AND T1.`date` = '2012-11-09' | 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, --
); |
sales_in_weather | Give the number of stores which opened on the weather station that recorded the fastest average wind speed. | fastest average wind speed refers to Max(avgspeed); number of store refers to count(store_nbr) | SELECT COUNT(T.store_nbr) FROM ( SELECT DISTINCT store_nbr FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY avgspeed DESC LIMIT 1 ) ) T | 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 is the highest closed price of CHNCoin? | the highest closed price refers to max(close) | SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'CHNCoin' ORDER BY T2.close 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, --
); |
shakespeare | In Shakespeare's works between 1600 to 1610, how many of these have a character as a "Third Servingman"? | between 1600 to 1610 refers to DATE > = 1600 AND DATE < = 1610; "Third Servingman" refers to CharName = 'Third Servingman' | SELECT COUNT(DISTINCT T2.work_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 WHERE T1.DATE BETWEEN 1600 AND 1610 AND T4.CharName = 'Third Servingman' | 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 what percentage of games played at the Dr DY Patil Sports Academy venue did the winning team win by a margin of less than 10? | Dr DY Patil Sports Academy venue refers to Venue_Name = 'Dr DY Patil Sports Academy'; win by a margin of less than 10 refers to Win_Margin < 10; percentage = divide(count(Venue_Id) when Win_Margin < 10, sum(Venue_Id)) as percentage | SELECT CAST(COUNT(CASE WHEN T2.Win_Margin < 10 THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Venue_Id) FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name = 'Dr DY Patil Sports Academy' | 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 | Tell the wet-bulb temperature of the weather station which contained store no.6 on 2012/2/15. | store no.6 refers to store_nbr = 6; on 2012/2/15 refers to date = '2012-02-15'; wet-bulb temperature refers to wetbulb | SELECT T1.wetbulb FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 14 AND T1.`date` = '2012-02-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 | When is the best time to purchase Bitcoin? | lowest price refers to low; best time refers to date with the low; | SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.low 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 games did BMG Interactive Entertainment release in 2012? | BMG Interactive Entertainment refers to publisher_name = 'BMG Interactive Entertainment'; release in 2012 refers to release_year = 2012; | SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = 2012 | 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 "Florence. Without the walls. A tucket afar off", what is the id of the character that was mentioned in "His name, I pray you."? | "Florence. Without the walls. A tucket afar off" refers to chapters.Description = 'Florence. Without the walls. A tucket afar off.'; "His name, I pray you." refers to PlainText = 'His name, I pray you.' | SELECT T1.character_id FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.PlainText = 'His name, I pray you.' AND T2.Description = 'Florence. Without the walls. A tucket afar off.' | 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 | For the home weather station of store no.15, what was the dew point on 2012/2/18? | store no. 15 refers to store_nbr = 15; on 2012/2/18 refers to date = '2012-02-18' | SELECT T1.dewpoint FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 15 AND T1.`date` = '2012-02-18' | 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 | List the names of the top five coins traded on January 1, 2014. | the top five coins refers to cmc_rank< = 5; on January 1, 2014 refers to date = '2014-01-01' | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2014-01-01' AND T2.cmc_rank <= 5 | 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 | Provide the name of games released in 2015. | names of games refers to game_name; released in 2015 refers to release_year = 2015; | SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2015 | 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 players were born before 10/16/1975, and have a bowling skill of less than 3? | born before 10/16/1975 refers to DOB < 1975-10-16; bowling skill of less than 3 refers to Bowling_skill < 3 | SELECT COUNT(*) FROM Player WHERE DOB < '1975-10-16' AND Bowling_skill < 3 | 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 | For the weather station which recorded the highest temperature above the 30-year normal, how many stores does it have? | highest temperature above the 30-year normal refers to Max(depart) | SELECT store_nbr FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY depart 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 | Name the coins that were not opened on May 2013. | not opened refers to open IS NULL; on May 2013 refers to year(date) = 2019 AND month(date) = 5 | SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y-%m', T2.date) = '2013-05' 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, --
); |
soccer_2016 | What is the total number of runs scored by the batsmen during the 2nd inning of the match ID 335988? | number of runs refers to Runs_Scored; 2nd inning refers to Innings_No = 2 | SELECT SUM(Runs_Scored) FROM Batsman_Scored WHERE Match_Id = 335988 AND Innings_No = 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 | Tell the temperature range of the home weather station of store no.7 on 2014/4/28. | store no.7 refers to tore_nbr = 7; on 2014/4/28 refers to date = '2014-04-28'; temperature range refers to Subtract (tmax, tmin) | SELECT T1.tmax - T1.tmin AS temprange FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 7 AND T1.`date` = '2014-04-28' | 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 is Devcoin most valuable in the market? | when refers to date; most valuable refers to max(market_cap) | SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Devcoin' ORDER BY T2.market_cap 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 | Calculate the total sales in all regions with game platform ID 66. | total sales in all regions = MULTIPLY(SUM(num_sales), 100000); | SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 66 | 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 character and work ID of the text "Fear not thou, man, thou shalt lose nothing here."? | character refers to chapter_id; text "Fear not thou, man, thou shalt lose nothing here." refers to PlainText = 'Fear not thou, man, thou shalt lose nothing here.' | SELECT T2.character_id, T1.work_id FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'Fear not thou, man, thou shalt lose nothing here.' | 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 weather station does store no.20 belong to? | store no.20 refers to store_nbr = 20; weather station refers to station_nbr | SELECT station_nbr FROM relation WHERE store_nbr = 20 | 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 is the highest price of Terracoin? | when refers to date; the highest price refers to max(price) | SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Terracoin' ORDER BY T2.price 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 | List the games available on Wii. | games available refers to game_name; Wii refers to platform_name = 'Wii'; | SELECT T4.game_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T1.platform_name = 'Wii' | 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, --
); |
sales_in_weather | Give the id of the weather station with most stores. | station with more stores refers to Max(Count(store_nbr)); ID of weather station refers to station_nbr | SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(station_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 | When did Peercoin rank fifth? | when refers to date; rank fifth refers to cmc_rank = 5 | SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Peercoin' AND T2.cmc_rank = 5 | 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 name of the company that produced the game titled Adventure Time: Explore the Dungeon Because I Don't Know!? | name of the company that produced the game refers to publisher_name; Adventure Time: Explore the Dungeon Because I Don't Know! Refers to game_name = 'Adventure Time: Explore the Dungeon Because I Don''t Know!'; | SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = 'Adventure Time: Explore the Dungeon Because I Don''t Know!' | 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 | Among the history works written by Shakespeare, how many works whose 1st acts have no more than 2 scenes? | history refers to GenreType = 'History' ; 1st acts refers to Act = 1; no more than 2 scenes refers to count(Scene) < 2 | SELECT COUNT(DISTINCT T2.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T2.Scene < 2 AND T1.GenreType = 'History' | 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 | Provide the match IDs which were held on 18th April 2015. | on 18th April 2015 refers to DATE(Match_Date) = '2015-04-18' | SELECT Match_Id FROM Match WHERE Match_Date LIKE '%2015-04-18%' | 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 | Tell the resultant wind speed of station no.9 on 2014/1/15. | station no.9 refers to station_nbr = 9; on 2014/1/15 refers to date = '2014/01/15'; result wind speed refers to resultspeed | SELECT resultspeed FROM weather WHERE `date` = '2014-01-15' AND station_nbr = 9 | 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 percentage of coins that is higher than the price 1 hour ago in May 29,2013? List the names of these coins. | percentage that is higher than the price 1 hour ago refers to percent_change_1h>0; in May 29,2013 refers to date = '2013-05-29' | SELECT T1.NAME FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T2.DATE = '2013-05-29' AND T2.percent_change_1h > 0 | 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 | When did Roma host the Olympic Games? | Roma refers to city_name = 'Roma'; When host refers to games_year; | SELECT T3.games_year FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Roma' | 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 percentage of games are sports? | percentage = MULTIPLY(DIVIDE(SUM(genre_name = 'sport'), COUNT(game_name)), 100.0); sports refers to genre_name = 'sport'; | SELECT CAST(COUNT(CASE WHEN T1.genre_name = 'Sports' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_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 | In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by Viola? | Twelfth Night refers to Title = 'Twelfth Night'; total number of lines said by Viola refers to count(character_id) where CharName = 'Viola' | SELECT COUNT(T4.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 WHERE T2.Act = 1 AND T2.Scene = 2 AND T4.id = 1238 AND T4.CharName = 'Viola' AND T1.Title = 'Twelfth Night' | 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 | Give the average temperature of station no.20 on 2014/10/17. | station no.20 refers to station_nbr = 20; on 2014/10/17 refers to date = '2014-10-17'; average temperature refers to tavg | SELECT tavg FROM weather WHERE `date` = '2014-10-17' AND station_nbr = 20 | 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 was Lebowskis not opened? | when refers to date; not opened refers to open IS NULL | SELECT DISTINCT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Lebowskis' AND (T2.open IS NULL OR T2.open = 0) | 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 | Provide the name of game produced by 505 Games in 2006. | name of game refers to game_name; 505 Games refers to publisher_name = '505 Games'; in 2006 refers to release_year = 2006; | SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN publisher AS T4 ON T2.publisher_id = T4.id WHERE T4.publisher_name = '505 Games' AND T1.release_year = 2006 | CREATE TABLE region_sales
(
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (region_id) references region(id),
region_id INTEGER default NULL, -- Example Values: `1`, `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 the 5th act of "History of Henry VIII"? | 5th act refers to Act = 5; "History of Henry VIII" refers to LongTitle = 'History of Henry VIII' | SELECT SUM(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 5 AND T1.LongTitle = 'History of Henry VIII' | 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 did the matches were held in MA Chidambaram Stadium from 5/9/2009 to 8/8/2011? | MA Chidambaram Stadium refers to Venue_Name = 'MA Chidambaram Stadium' ; from 5/9/2009 to 8/8/2011 refers to Match_Date between '2009-05-09' and '2011-08-08' | SELECT SUM(CASE WHEN Venue_Name = 'MA Chidambaram Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE Match_Date BETWEEN '2009-05-09' AND '2011-08-08' | 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 no.9 items from store no.11 were sold on 2012/12/7? | no. 9 item refers to item_nbr = 9; store no.11 refers to store_nbr = 11; sold on 2012/12/7 refers to date = '2012-12-07' | SELECT units FROM sales_in_weather WHERE `date` = '2012-12-07' AND store_nbr = 11 AND item_nbr = 9 | 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 | List the names of the coins above the average price on April 28, 2013. | average price = divide(sum(price), count(name)); on April 28, 2013 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 = '2018-04-28' AND T2.price > ( SELECT AVG(price) FROM historical WHERE date = '2018-04-28' ) | 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 total number of adventure games released in 2005? | adventure games refers to game_name WHERE genre_name = 'Adventure'; released in 2005 refers to release_year = 2005; | SELECT COUNT(DISTINCT T3.id) FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Adventure' AND T1.release_year = 2005 | 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 the scene numbers involving the character named Sir Toby Belch in the Twelfth Night. | scene numbers refers to Scene; character named Sir Toby Belch refers to CharName = 'Sir Toby Belch'; in the Twelfth Night refers to Title = 'Twelfth Night' | SELECT DISTINCT T2.Scene 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 = 'Twelfth Night' AND T4.CharName = 'Sir Toby Belch' | 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 | Tally the player IDs of "Man of the Series" awardees for the seasons from 2011 to 2015. | seasons from 2011 to 2015 refers to 2011 < Season_Year < 2015 | SELECT Man_of_the_Series FROM Season WHERE 2011 < Season_Year < 2015 | 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 | Give the id of the bestsellers of store no.1 on 2012/1/1. | store no. 1 refers to store_nbr = 1; on 2012/1/1 refers to date = '2012-01-01'; best seller refers to Max(units); ID refers to item_nbr | SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY 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, --
); |
retail_world | To whom does Nancy Davolio report? Please give that employee's full name. | to whom refers to ReportsTo; full name = FirstName, LastName; | SELECT FirstName, LastName FROM Employees WHERE EmployeeID = ( SELECT ReportsTo FROM Employees WHERE LastName = 'Davolio' AND FirstName = 'Nancy' ) | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
soccer_2016 | Give me the match ID and date of the matches that were held in Kingsmead for three consecutive days. | date of the matches refers to Match_Date; held in Kingsmead refers to Venue_Name = 'Kingsmead' | SELECT T1.Match_Id, T1.Match_Date FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'Kingsmead' | 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 percentage of the units of item no.5 sold among all units of items sold in store no.3 on the day with the highest max temperature in 2012? | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; highest max temperature refers to Max(tmax); in 2012 refers to SUBSTR(date, 1, 4) = '2012'; Percentage = Divide (Sum(units where item_nbr = 5), Sum(units)) * 100 | SELECT CAST(SUM(CASE WHEN T1.item_nbr = 5 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) 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 T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' AND T3.tmax = ( SELECT MAX(T3.tmax) 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 T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' ) | 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 many times was Bytecoin traded in June 2013? | in June 2013 refers to year(date) = 2013 AND month(date) = 6 | SELECT COUNT(T2.coin_id) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bytecoin' AND STRFTIME('%Y-%m', T2.date) = '2013-06' | 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 game platform ID and region name where the games achieved 20000 sales and below. | 20000 sales and below refers to num_sales < 0.2; | SELECT T2.game_platform_id, T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.num_sales * 100000 <= 20000 | 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 | Among the chapters in "As You Like It", how many chapters have a paragraph number of no more than 50? | "As You Like It" refers to Title = 'As You Like It' ;paragraph number of no more than 50 refers to ParagraphNum < 50 | SELECT COUNT(T3.chapter_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 T1.Title = 'As You Like It' AND T3.ParagraphNum < 50 | 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 team wins the toss during the match ID 336011, and can you tell me whether they decided to bat or field? | wins the toss refers to Toss_Winner; whether they decided to bat or field refers to Toss_Name | SELECT T2.Toss_Name, T1.Toss_Decide, T1.Toss_Winner FROM `Match` AS T1 INNER JOIN Toss_Decision AS T2 ON T1.Toss_Decide = T2.Toss_Id WHERE T1.Match_Id = '336011' | 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 units of item no.5 were sold in store no.3 on average on the days when the max temperature exceeded 90? | item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; when the maximum temperature exceed 90 refers to tmax > 90; average = Divide (Sum(units), Count(date)) | SELECT CAST(SUM(T1.units) AS REAL) / COUNT(T1.`date`) 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 T1.store_nbr = 3 AND T1.item_nbr = 5 AND T3.tmax > 90 | 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, --
); |
retail_world | How many employees have obtained a doctorate? | doctorate refers to TitleOfCourtesy = 'Dr.; | SELECT COUNT(EmployeeID) FROM Employees WHERE TitleOfCourtesy = 'Dr.' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
soccer_2016 | Between match nos. 335989 and 337000, how many times did a batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches? | Between match no. 335989 and 337000 refers to 335989 < Match_Id < 337000; batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches refers to Runs_Scored > 3 and Over_Id = 1 and Ball_Id = 1 and Innings_No = 1 | SELECT SUM(CASE WHEN Runs_Scored > 3 THEN 1 ELSE 0 END) FROM Batsman_Scored WHERE 335989 < Match_Id < 337000 AND Innings_No = 1 AND Over_Id = 1 AND Ball_Id = 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 the day with the highest max temperature in 2012, how many items in store no.3 had no sales? | highest max temperature refers to Max(tmax); in 2012 refers to SUBSTR(date, 1, 4) = '2012'; store no.3 refers to store_nbr = 3; had no sale refers to units = 0 | SELECT COUNT(DISTINCT 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 AND T1.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.units = 0 GROUP BY T3.tmax ORDER BY T3.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, --
); |
retail_world | How many employees have Andrew Fuller as their direct supervisor? | direct supervisor refers to ReportsTo where the person being reported to is usually the direct supervisor of the reporter; | SELECT COUNT(EmployeeID) FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' ) | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
video_games | How many video game publishers have Interactive in their names? | publishers that have Interactive in their names refers to publisher_name LIKE '%Interactive%'; | SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%' | 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 chapter description where the paragraph "What, wilt thou hear some music, my sweet love?" belongs? | paragraph "What, wilt thou hear some music, my sweet love?" refers to PlainText = 'What, wilt thou hear some music, my sweet love?' | SELECT T1.id, T1.Description FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'What, wilt thou hear some music, my sweet love?' | 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 | Where was the ID 336005 match held? Please give me the venue and the city. | ID 336005 match refers to Match_Id = '336005'; venue refers to Venue_Name; city refers to City_Name | SELECT T2.Venue_Name, T3.City_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN City AS T3 ON T2.City_Id = T3.City_Id WHERE T1.Match_Id = '336005' | 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 ID of the item that sold the best on the day with the highest max temperature in store no.3 in 2012? | highest max temperature refers to Max(tmax); store no.3 refers to store_nbr = 3; in 2012 refers to substring (date, 1, 4) = '2012'; sold the best refers to Max(units); ID of the 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 weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' AND tmax = ( SELECT MAX(tmax) 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 T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' ) GROUP BY T1.item_nbr ORDER BY SUM(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, --
); |
video_games | List the game IDs of the games produced by Abylight. | Abylight refers to publisher_name = 'Abylight'; | SELECT T1.game_id FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Abylight' | 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 characters are there in Hamlet? | Hamlet refers to Title = 'Hamlet' | SELECT COUNT(DISTINCT T3.character_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 T1.Title = 'Hamlet' | 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 | Write down the name of players whose bowling skill is Legbreak. | name of players refers to Player_Name | SELECT T2.Player_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill WHERE T1.Bowling_skill = 'Legbreak' | 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 more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10? | store no. 5 refers to store_nbr = 5; store no. 10 refers to store_nbr = 10; item no.16 refers to item_nbr = 16; in 2012 refers to SUBSTR(date, 1, 4) = '2012'; highest max temperature refers to Max(tmax); more units sold refers to Subtract ( Sum(units where store_nbr = 5), Sum(units where store_nbr = 10)) | SELECT ( SELECT SUM(units) 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 T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 5 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 ) - ( SELECT SUM(units) 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 T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 6 GROUP BY tmax ORDER BY T3.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, --
); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.