db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
restaurant
What is the restaurant's name and ID located at Ocean Avenue, San Francisco?
restaurant's name refers to label; Ocean Avenue refers to street_name = 'ocean avenue'; San Francisco refers to city = 'san francisco'
SELECT T2.label, T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'ocean avenue'
restaurant
What is the full address of the restaurant named "Sanuki Restaurant"?
full address refers to city, street_num, street_name; restaurant named "Sanuki Restaurant" refers to label = 'sanuki restaurant'
SELECT T2.city, T1.street_num, T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'sanuki restaurant'
restaurant
How many American restaurants are located in Front, San Francisco?
American restaurant refers to food_type = 'american'; Front refers to street_name = 'front'; San Francisco refers to city = 'san francisco'
SELECT COUNT(T2.food_type = 'american') FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'front'
restaurant
List the restaurant's ID that has a review greater than the 70% of average review of all American restaurants with street number greater than 2000.
American restaurant refers to food_type = 'american'; street number greater than 2000 refers to street_num > 2000; review greater than the 70% of average review refers to review > multiply(avg(review), 0.7)
SELECT T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'american' AND T1.street_num > 2000 GROUP BY T1.id_restaurant ORDER BY AVG(T2.review) * 0.7 DESC
restaurant
What is the name of the most popular restaurant serving Asian foods in San Francisco?
the most popular refers to max(review); Asian food refers to food_type = 'asian'; San Francisco refers to city = 'san francisco'
SELECT label FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' )
restaurant
How many cities are there in Monterey?
Monterey refers to region = 'monterey'
SELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey'
restaurant
How many deli in Belmont have a review rating of 2 or more?
deli ris a food type; Belmont refers to city = 'belmont'; review rating of 2 or more refers to review > 2
SELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli'
restaurant
Which county in northern California has the highest number of cities?
northern California refers to region = 'northern california'; the highest number of cities refers to max(count(city))
SELECT county FROM geographic WHERE region = 'northern california' GROUP BY county ORDER BY COUNT(city) DESC LIMIT 1
restaurant
How many restaurants can you find in Concord?
Concord refers to city = 'concord'
SELECT COUNT(id_restaurant) FROM location WHERE city = 'concord'
restaurant
In which region can you find the top 4 most popular restaurants?
the top 4 most popular restaurant refers to top 4 max(review)
SELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4
restaurant
How many Chinese restaurants are there on 1st st, Livermore?
Chinese restaurant refers to food_type = 'chinese'; 1st st refers to street_name = '1st st'; Livermore refers to city = 'livermore'
SELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'livermore' AND T1.food_type = 'chinese' AND T2.street_name = '1st st'
restaurant
How many Indian restaurants are there in the Los Angeles area?
Indian restaurant refers to food_type = 'indian'; the Los Angeles area refers to region = 'los angeles area'
SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'indian' AND T1.region = 'los angeles area'
restaurant
In the Bay Area, what is the most common type of food served by restaurants?
the Bay Area refers to region = 'bay area'; the most common type of food refers to max(count(food_type))
SELECT T2.food_type FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area' GROUP BY T2.food_type ORDER BY COUNT(T2.food_type) DESC LIMIT 1
restaurant
How many restaurants in Broadway, Oakland received a review of no more than 3?
Broadway refers to street_name = 'broadway';  Oakland refers to city = 'oakland'; a review of no more than 3 refers to review < 3
SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.street_name = 'broadway' AND T2.review < 3 AND T1.city = 'oakland'
restaurant
In which region can you find the highest number of Baskin Robbins restaurants?
the highest number refers to max(count(city)); Baskin Robbins restaurant refers to label = 'baskin robbins'
SELECT T2.region AS num FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'baskin robbins' GROUP BY T2.region ORDER BY COUNT(T1.city) DESC LIMIT 1
restaurant
List all the streets where pizza-serving restaurants are found in San Jose.
street refers to street_name; pizza-serving restaurant refers to food_type = 'pizza'; San Jose refers to city = 'san jose'
SELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'pizza' AND T1.city = 'san jose'
restaurant
How many types of restaurants are there in the Yosemite and Mono Lake area?
SELECT COUNT(T2.food_type) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'yosemite and mono lake area'
restaurant
What is the full address of the most popular restaurant among the diners?
full address refers to street_num, street_name, city; the most popular refers to max(review)
SELECT T2.street_name, T2.street_num, T2.city FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1
restaurant
In which counties can you find the restaurant with the highest number of branches?
restaurant refers to label; the highest number of branches refers to max(count(city))
SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city GROUP BY T2.county ORDER BY COUNT(T1.label) DESC LIMIT 1
restaurant
Which region has the highest number of restaurants?
the highest number refers to max(count(id_restaurant))
SELECT T1.region FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city GROUP BY T1.region ORDER BY COUNT(T2.id_restaurant) DESC LIMIT 1
restaurant
List the full address of all the American restaurants with a review of 4 or more?
full address refers to street_num, street_name, city; American restaurant refers to food_type = 'american'; a review of 4 or more refers to review > 4
SELECT T1.street_num, T1.street_name, T1.city FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.review >= 4
soccer_2016
How many players are from Australia?
Australia refers to Country_Name = 'Australia'
SELECT COUNT(CASE WHEN T2.Country_Name = 'Australia' THEN T1.Player_Id ELSE NULL END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id
soccer_2016
Which country is the oldest player from?
country refers to Country_Name; the oldest refers to min(DOB)
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.Country_Name IS NOT NULL ORDER BY T2.DOB LIMIT 1
soccer_2016
What is the bowling skill of SC Ganguly?
SC Ganguly refers to Player_Name = 'SC Ganguly'
SELECT T1.Bowling_Skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T2.Bowling_skill = T1.Bowling_Id WHERE T2.Player_Name = 'SC Ganguly'
soccer_2016
Please list the names of the players who use the right hand as their batting hand and are from Australia.
name of player refers to Player_Name; right hand as batting hand refers to Batting_Hand = 'Right-hand bat'; Australia refers to Country_Name = 'Australia'
SELECT T2.Player_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_id INNER JOIN Batting_Style AS T3 ON T2.Batting_hand = T3.Batting_Id WHERE T1.Country_Name = 'Australia' AND T3.Batting_Hand = 'Right-hand bat'
soccer_2016
Please list the bowling skills of all the players from Australia.
Australia refers to Country_Name = 'Australia'
SELECT T2.Bowling_Skill FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id INNER JOIN Country AS T3 ON T1.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'Australia' GROUP BY T2.Bowling_Skill
soccer_2016
Among the players whose bowling skill is "Legbreak", when was the oldest one of them born?
the oldest refers to min(DOB); date of birth refers to DOB
SELECT MIN(T1.DOB) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_Skill = 'Legbreak'
soccer_2016
What is the bowling skill used by most players?
bowling skill used by most players refers to max(count(Bowling_Skill))
SELECT T1.Bowling_Skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T2.Bowling_skill = T1.Bowling_Id GROUP BY T1.Bowling_Skill ORDER BY COUNT(T1.Bowling_Skill) DESC LIMIT 1
soccer_2016
What is the name of the player who won the "man of the match" award in the match on 2008/4/18?
name of player refers to Player_Name; on 2008/4/18 refers to Match_Date = '2008-04-18'
SELECT T2.Player_Name FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T1.Match_Date = '2008-04-18'
soccer_2016
For how many times has SC Ganguly played as team captain in a match?
SC Ganguly refers to Player_Name = 'SC Ganguly'; team captain refers to Role_Desc = 'Captain'
SELECT SUM(CASE WHEN T3.Role_Desc = 'Captain' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id WHERE T1.Player_Name = 'SC Ganguly'
soccer_2016
What is the role of SC Ganguly in the match on 2008/4/18?
role refers to of Role_Id; SC Ganguly refers to Player_Name = 'SC Ganguly'; on 2008/4/18 refers to Match_Date = '2008-04-18'
SELECT T2.Role_Id FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Match AS T4 ON T2.Match_Id = T4.Match_Id WHERE T1.Player_Name = 'SC Ganguly' AND T4.Match_Date = '2008-04-18'
soccer_2016
Among all the matches SC Ganguly has played in, what is the highest winning margin?
SC Ganguly refers to Player_Name = 'SC Ganguly'; the highest winning margin refers to max(Win_Margin)
SELECT MAX(T3.Win_Margin) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'
soccer_2016
What is the average winning margin of all the matches SC Ganguly has played in?
SC Ganguly refers to Player_Name = 'SC Ganguly'; the average winning margin = divide(sum(Win_Margin), count(Match_Id)) where Player_Name = 'SC Ganguly'
SELECT CAST(SUM(T3.Win_Margin) AS REAL) / COUNT(*) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'
soccer_2016
Give the name of the youngest player.
name of player refers to Player_Name; the youngest refers to max(DOB)
SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1
soccer_2016
Give the name of the striker in the match no. 419169, over no.3, ball no.2, inning no.2.
name of the striker refers to Player_Name; match no. 419169 refers to Match_Id = 419169; over no.3 refers to Over_Id = 3; ball no.2 refers to Ball_Id = 2; inning no.2 refers to Innings_No = 2
SELECT T2.Player_Name FROM Ball_by_Ball AS T1 INNER JOIN Player AS T2 ON T1.Striker = T2.Player_Id WHERE T1.Match_Id = 419169 AND T1.Over_Id = 3 AND T1.Ball_Id = 2 AND T1.Innings_No = 2
soccer_2016
For the game on 2008/5/12, who was the man of the match?
on 2008/5/12 refers to Match_Date = '2008-05-12'; name refers to Player_Name;
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Match_Date = '2008-05-12'
soccer_2016
State the name of captain keeper of the match no.419117.
name refers to Player_Name; captain keeper refers to Role_Desc = 'CaptainKeeper'; match no.419117 refers to Match_Id = '419117'
SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T1.Match_Id = '419117' AND T2.Role_Desc = 'CaptainKeeper'
soccer_2016
Who was the man of the series in 2013? Give the full name.
full name refers to Player_Name; in 2013 refers to Season_Year = 2013
SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2013
soccer_2016
Give the date of birth of the 2014 Orange Cap winner.
date of birth refers to DOB; 2014 refers to Season_Year = 2014; Orange Cap winner refers to Orange_Cap IS NOT NULL
SELECT T2.DOB FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2014 AND T1.Orange_Cap IS NOT NULL
soccer_2016
What is the nationality of the 7th season Purple Cap winner?
nationality refers to Country_Name; the 7th season refers to Season_Id = 7; Purple Cap winner refers to Purple_Cap IS NOT NULL
SELECT T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Id = 7 AND T1.Purple_Cap IS NOT NULL
soccer_2016
Which country does Ranchi city belong to?
country refers to Country_Name; Ranchi city refers to City_Name = 'Ranchi'
SELECT T2.Country_Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id WHERE T1.City_Name = 'Ranchi'
soccer_2016
How many Indian cities are there in the database?
Indian refers to Country_Name = 'India'
SELECT SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id
soccer_2016
State the name of the city with the most venues.
name of the city refers to City_Name; the most venues refers to max(count(Venue_Id))
SELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T1.City_Id = T2.City_Id GROUP BY T1.City_Id ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1
soccer_2016
What is the batting hand of MK Pandey?
MK Pandey refers to Player_Name = 'MK Pandey'
SELECT T2.Batting_hand FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T1.Player_Name = 'MK Pandey'
soccer_2016
In the database, how many times is the number of Indian cities to the South African cities?
Indian refers to Country_Name = 'India'; South African refers to Country_Name = 'South Africa'; how many times = divide(count(City_Id where Country_Name = 'India'), count(City_Id where Country_Name = 'South Africa'))
SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id
soccer_2016
Who is the oldest player?
name of the player refers to Player_Name; the oldest refers to min(DOB)
SELECT Player_Name FROM Player ORDER BY DOB ASC LIMIT 1
soccer_2016
How many players were born in the 90s?
born in the 90s refers to DOB > = '1990-01-01' AND DOB < = '1999-12-31'
SELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31'
soccer_2016
List the id of the player who won the Orange Cap for 2 consecutive seasons.
id of the player who won the Orange Cap refers to Orange_Cap; for 2 consecutive seasons refers to count(Season_Year) > 1
SELECT Orange_Cap FROM Season GROUP BY Orange_Cap HAVING COUNT(Season_Year) > 1
soccer_2016
How many umpires are from South Africa?
South Africa refers to Country_Name = 'South Africa'
SELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country
soccer_2016
How many Orange Cap awards were won by CH Gayle?
CH Gayle refers to Player_Name = 'CH Gayle'
SELECT SUM(CASE WHEN T1.Player_Name = 'CH Gayle' THEN 1 ELSE 0 END) AS cnt FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Orange_Cap
soccer_2016
Which venue did Kolkata Knight Riders play most of their matches as a Team 1?
venue refers to Venue_Name; Kolkata Knight Riders refers to Team_Name = 'Kolkata Knight Riders'; most of their matches refers to max(count(Venue_Id)); Team 1 refers to Team_Id = Team_1
SELECT T3.Venue_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 INNER JOIN Venue AS T3 ON T2.Venue_Id = T3.Venue_Id WHERE T1.Team_Name = 'Kolkata Knight Riders' GROUP BY T3.Venue_Id ORDER BY COUNT(T3.Venue_Id) DESC LIMIT 1
soccer_2016
Which team has the highest number of losses of all time?
name of the team refers to Team_Name; the highest number of losses refers to max(add(count(Team_1 where Team_Id = Team_1 and Team_1 <> Match_Winner), count(Team_2 where Team_Id = Team_2 and Team_2 <> Match_Winner)))
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN ( SELECT COUNT(Team_1) AS a, Team_1 FROM Match WHERE Team_1 <> Match_Winner GROUP BY Team_1 UNION SELECT COUNT(Team_2) AS a, Team_2 FROM Match WHERE Team_2 <> Match_Winner GROUP BY Team_2 ORDER BY a DESC LIMIT 1 ) AS T2 ON T1.Team_Id = T2.Team_1
soccer_2016
How many players with left-hand batting style are from India?
left-hand batting style refers to Batting_hand = 'Left-hand bat'; India refers to Country_Name = 'India'
SELECT SUM(CASE WHEN T1.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS cnt FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_Id = T2.Batting_hand INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'India'
soccer_2016
Who is the player that has the highest number of roles as a captain for Deccan Chargers?
name of the player refers to Player_Name; the highest number of roles refers to max(count(Role_Id)); as a captain refers to Role_Desc = 'Captain'; Deccan Chargers refers to Team_Name = 'Deccan Chargers'
SELECT T4.Player_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_id = T2.Team_id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Player AS T4 ON T2.Player_Id = T4.Player_Id WHERE T1.Team_Name = 'Deccan Chargers' AND T1.Team_Id = 8 AND T3.Role_Desc = 'Captain' AND T3.Role_Id = 1 GROUP BY T4.Player_Id ORDER BY COUNT(T3.Role_Id) DESC LIMIT 1
soccer_2016
What is the percentage of all right-handed batting players among all the other players?
right-handed batting refers to Batting_hand = 'Right-hand bat'; percentage = divide(count(Player_Id where Batting_hand = 'Right-hand bat'), count(Player_Id)) * 100%
SELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Player_Id) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T2.Batting_hand = T1.Batting_Id
soccer_2016
Name the player who is born on July 7, 1981.
name of the player refers to Player_Name; born on July 7 1981 refers to DOB = '1981-07-07'
SELECT Player_name FROM Player WHERE DOB = '1981-07-07'
soccer_2016
How many matches were played by the player with player ID 2?
player ID 2 refers to Player_Id = 2
SELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match
soccer_2016
List the first team's name in the match with the highest winning margin.
team's name refers to Team_Name; first team refers to Team_Id = Team_1; the highest winning margin refers to max(Win_Margin)
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 ORDER BY T1.Win_Margin DESC LIMIT 1
soccer_2016
Give the country where St. George's Park is located.
country refers to Country_Name; St. George's Park refers to Venue_Name = 'St George''s Park'
SELECT T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_id WHERE T1.Venue_Name = 'St George''s Park'
soccer_2016
List the player's name of Mumbai Indians in the match ID 335990.
Mumbai Indians refers to Team_Name = 'Mumbai Indians'; match ID 335990 refers to Match_Id = 335990
SELECT T3.Team_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T2.Match_Id = 335990 AND T3.Team_Name = 'Mumbai Indians' GROUP BY T3.Team_Name
soccer_2016
Provide the winning team's name in the match with the point of winning margin of 7 on May 7, 2009.
the winning team refers to Team_Id = Match_Winner; the point of winning margin of 7 refers to Win_Margin = 7; on May 7 2009 refers to Match_Date = '2009-05-07'
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date = '2009-05-07' AND T2.Win_Margin = 7
soccer_2016
How many of the matches are Superover?
Superover refers to Outcome_Type = 'Superover'
SELECT SUM(CASE WHEN T2.Outcome_Type = 'Superover' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Outcome AS T2 ON T2.Outcome_Id = T1.Outcome_type
soccer_2016
List the cities located in U.A.E.
city refers to City_Name; U.A.E refers to Country_Name = 'U.A.E'
SELECT T1.City_Name FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id WHERE T2.Country_Name = 'U.A.E'
soccer_2016
What is the total number of won matches of the team named "Pune Warriors"?
the team named "Pune Warriors" refers to Team_Name = 'Pune Warriors'; the total number of won matches = count(Team_Name where Team_Id = Match_Winner)
SELECT SUM(CASE WHEN T2.Team_Name = 'Pune Warriors' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner
soccer_2016
What is the role of K Goel in the match ID 335992?
role refers to Role_Desc; K Goel refers to Player_Name = 'K Goel'; match ID 335992 refers to Match_Id = 335992
SELECT T3.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Rolee AS T3 ON T3.Role_Id = T2.Role_Id WHERE T2.Match_Id = 335992 AND T1.Player_Name = 'K Goel'
soccer_2016
How many cities are located in South Africa?
South Africa refers to Country_Name = 'South Africa'
SELECT SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id
soccer_2016
How many matches were held at the venue named "Newlands"?
the venue named "Newlands" refers to Venue_Name = 'Newlands'
SELECT SUM(CASE WHEN T2.Venue_Name = 'Newlands' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id
soccer_2016
Provide the point of the winning margin in a match between Mumbai Indians and Royal Challengers Bangalore on May 28, 2008.
point of the winning margin refers to Win_Margin; Mumbai Indians refers to Team_Name = 'Mumbai Indians'; Royal Challengers Bangalore refers to Team_Name = 'Royal Challengers Bangalore'; on May 28 2008 refers to Match_Date = '2008-05-28'
SELECT T1.Win_Margin FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE (T2.Team_Name = 'Mumbai Indians' AND T3.Team_Name = 'Royal Challengers Bangalore' AND T1.Match_Date = '2008-05-28') OR (T2.Team_Name = 'Royal Challengers Bangalore' AND T3.Team_Name = 'Mumbai Indians' AND T1.Match_Date = '2008-05-28')
soccer_2016
How many overs were there in the first innings of match ID "335996"?
the first innings refers to Innings_No = 1; match ID "335996" refers to Match_Id = 335996
SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1
soccer_2016
List the over IDs, ball IDs, and innings numbers of the match ID "336004" while the batsman got the maximum scores.
over ID refers to Over_Id; ball ID refers to Ball_Id; innings number refers to Innings_No; match ID "336004" refers to Match_Id = 336004; batsman got the maximum scores refers to max(Runs_Scored)
SELECT Over_Id, Ball_Id, Innings_No FROM Batsman_Scored WHERE Match_Id = 336004 ORDER BY Runs_Scored DESC LIMIT 1
soccer_2016
Describe any five matches IDs that reached over ID 20.
reached over ID 20 refers to Over_Id = 20
SELECT Match_Id FROM Ball_by_Ball WHERE Over_Id = 20 GROUP BY Match_Id LIMIT 5
soccer_2016
How many players got out in the first inning of match ID "548335"?
got out refers to Player_Out; the first inning refers to Innings_No = 1; match ID "548335" refers to Match_Id = 548335
SELECT SUM(CASE WHEN Match_Id = 548335 THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Innings_No = 1
soccer_2016
List the match IDs which had players out by hit wickets.
had players out by hit wickets refers to Out_Name = 'hit wicket'
SELECT T1.Match_Id FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'hit wicket'
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'
soccer_2016
How many times did Yuvraj Singh receive the Man of the Match award?
Yuvraj Singh refers to Player_Name = 'Yuvraj Singh'; receive the Man of the Match award refers to Player_Id = Man_of_the_Match
SELECT SUM(CASE WHEN T2.Player_Name = 'Yuvraj Singh' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match
soccer_2016
Who got the Man of the Series Award in 2010?
player's name refers to Player_Name; got the Man of the Series Award refers to Man_of_the_Match = Player_Id; in 2010 refers to Season_Year = 2010
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T2.Man_of_the_Match = T1.Player_Id INNER JOIN Season AS T3 ON T3.Season_Id = T2.Season_Id WHERE T3.Season_Year = 2010 GROUP BY T1.Player_Name
soccer_2016
Calculate the win rate of the team "Chennai Super Kings".
team "Chennai Super Kings" refers to Team_Name = 'Chennai Super Kings'; win rate = divide(count(Match_Id where Match_Winner = 3), count(Match_Id)) * 100%
SELECT CAST(SUM(CASE WHEN T1.Match_Winner = 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T2.Team_Name = 'Chennai Super Kings' OR T3.Team_Name = 'Chennai Super Kings'
soccer_2016
List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016.
player's name refers to Player_Name; country refers to Country_Name; Gujarat Lions refers to Team_Name = 'Gujarat Lions'; on 11th April 2016 refers to Match_Date = '2016-04-11'
SELECT T4.Player_Name, T5.Country_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_Id INNER JOIN Match AS T3 ON T3.Match_Id = T1.Match_Id INNER JOIN Player AS T4 ON T4.Player_Id = T1.Player_Id INNER JOIN Country AS T5 ON T5.Country_Id = T4.Country_Name WHERE T2.Team_Name = 'Gujarat Lions' AND T3.Match_Date = '2016-04-11'
soccer_2016
Provide the names and birthdates of players who have left-arm fast skills.
player's name refers to Player_Name; birthdate refers to DOB; have left-arm fast skills refers to Bowling_skill = 'Left-arm fast'
SELECT T1.Player_Name, T1.DOB FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T2.Bowling_Id = T1.Bowling_skill WHERE T2.Bowling_skill = 'Left-arm fast'
soccer_2016
Where did BR Doctrove come from?
the country the umpire comes from refers to Country_Name; BR Doctrove refers to Umpire_Name = 'BR Doctrove'
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Umpire AS T2 ON T2.Umpire_Country = T1.Country_Id WHERE T2.Umpire_Name = 'BR Doctrove'
soccer_2016
Who was the captain of the winning team in the match held on 1st June 2008?
player's name refers to Player_Name; captain refers to Role_Desc = 'Captain'; the winning team refers to Match_Winner = Team_Id; on 1st June 2008 refers to Match_Date = '2008-06-01'
SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Match AS T2 ON T2.Match_Id = T1.Match_Id INNER JOIN Player AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Rolee AS T4 ON T4.Role_Id = T1.Role_Id WHERE T2.Match_Date = '2008-06-01' AND T4.Role_Desc = 'Captain' AND T2.Match_Winner = T1.Team_Id
soccer_2016
Among the matches held in Mumbai, how many percent of them were held in Wankhede Stadium?
Mumbai refers to City_Name = 'Mumbai'; Wankhede Stadium refers to Venue_Name = 'Wankhede Stadium'; percent = divide(count(Match_Id where Venue_Name = 'Wankhede Stadium'), count(Match_Id)) * 100% where City_Name = 'Mumbai'
SELECT CAST(SUM(CASE WHEN T2.Venue_Name = 'Wankhede Stadium' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Match_Id) FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Match AS T3 ON T3.Venue_Id = T2.Venue_Id WHERE T1.City_Name = 'Mumbai'
soccer_2016
Among the players out in match ID 392187, calculate the percentage of players out by bowl.
out by bowl refers to Out_Name = 'bowled'; percentage = divide(count(Player_Out where Out_Name = 'bowled'), count(Player_Out)) * 100% where Match_Id = 392187
SELECT CAST(SUM(CASE WHEN T2.Out_Name = 'bowled' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T1.Match_Id = 392187
soccer_2016
How many percent of the toss-winners decided to bowl first on the pitch from 2010 to 2016?
decide to bowl first refers to Toss_Name = 'field'; from 2010 to 2016 refers to Match_Date BETWEEN '2010-01-01' AND '2016-12-31'; percent = divide(count(Toss_Id where Toss_Name = 'field'), count(Toss_Id)) * 100% where Match_Date BETWEEN '2010-01-01' AND '2016-12-31'
SELECT CAST(SUM(CASE WHEN T2.Toss_Name = 'field' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Toss_Id) FROM Match AS T1 INNER JOIN Toss_Decision AS T2 ON T2.Toss_Id = T1.Toss_Decide WHERE T1.Match_Date BETWEEN '2010-01-01' AND '2016-12-31'
soccer_2016
List down the ID of toss winners who decided to bat after winning the "toss of the coin".
decided to bat refers to Toss_Decide = 2; ID of toss winners refers to Toss_winner
SELECT Toss_Winner FROM Match WHERE Toss_Decide = 2
soccer_2016
List down the match ID of matches that the "man of the match" award was given to BB McCullum.
SELECT T1.Match_Id FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T2.Player_Name = 'BB McCullum'
soccer_2016
List down the DOB of players who received the "man of the match" award.
SELECT T2.DOB FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match
soccer_2016
List down the name of teams that won the toss of the coin from matches with ID from 336010 to 336020.
name of teams refers to Team_Name; won the toss refers to Toss_Winner; matches with ID from 336010 to 336020  refers to Match_Id BETWEEN 336010 AND 336020
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Toss_Winner WHERE T1.Match_Id BETWEEN 336010 AND 336020
soccer_2016
How many matches have Mumbai Indians won?
Mumbai Indians refers to Team_Name = 'Mumbai Indians'; won refers to Match_Winner
SELECT SUM(CASE WHEN T2.Team_Name = 'Mumbai Indians' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner
soccer_2016
List down names of teams that have played as second team against Pune Warriors.
names of teams refers to Team_Name; second team refers to Team_2; Pune Warriors refers to Team_Name = 'Pune Warriors'
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_2 WHERE T1.Team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Pune Warriors' ) GROUP BY T2.Team_Name
soccer_2016
What is the name of the team that won match ID 336000?
name of the team refers to Team_Name; won refers to Match_Winner
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Id = 336000
soccer_2016
What are the match IDs that were played at Brabourne Stadium?
at Brabourne Stadium refers to Venue_Name = 'Brabourne Stadium'
SELECT T1.Match_Id FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id WHERE T2.Venue_Name = 'Brabourne Stadium'
soccer_2016
List down the name of venues in season 2.
name of venues refers to Venue_Name; season 2 refers to Season_Id = 2
SELECT T2.Venue_Name FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id WHERE T1.Season_Id = 2 GROUP BY T2.Venue_Name
soccer_2016
What is the city of M Chinnaswamy Stadium?
city refers to City_Name; M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'
SELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium'
soccer_2016
List down all of the venues in Mumbai.
venues refers to Venue_Name; Mumbai refers to City_Name = 'Mumbai'
SELECT T2.Venue_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id WHERE T1.City_Name = 'Mumbai'
soccer_2016
List down all of the winning teams' IDs that played in St George's Park.
winning teams' refers to Match_Winner; played in St George's Park refers to Venue_Name like 'St George%'
SELECT T2.Match_Winner FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name LIKE 'St George%'
soccer_2016
Is SuperSport Park located at Centurion?
SuperSport Park refers to Venue_Name = 'SuperSport Park'; Centurion refers to City_Name = 'Centurion'
SELECT T2.City_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T1.Venue_Name LIKE 'St George%'
soccer_2016
Calculate the total winning match for Deccan Chargers.
winning refers to Match_Winner; Deccan Chargers refers to Team_Name = 'Deccan Chargers'
SELECT SUM(T2.Match_Winner) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T1.Team_Name = 'Deccan Chargers'
soccer_2016
Give the player id of the player who was at the non-striker end for the most number of balls in the match 501219.
most number of balls refers to max(Ball_Id); match 501219 refers to Match_Id = 501219; player id also refers to non_striker or ball_id
SELECT Ball_Id FROM Ball_by_Ball WHERE Non_Striker = Ball_Id ORDER BY Ball_Id DESC LIMIT 1
soccer_2016
Calculate the average runs scored during the first half of all first innings.
first half refers to 1 < Over_Id and Over_Id < 25; average = divide(sum(Over_Id) when 1 < Over_Id and Over_Id < 25, sum(Runs_Scored)) as percentage; first innings refers to Innings_No = 1
SELECT CAST(SUM(CASE WHEN 1 < Over_Id AND Over_Id < 25 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(Runs_Scored) FROM Batsman_Scored WHERE Innings_No = 1