db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
soccer_2016
What are the average extra runs given in the second innings of every match?
second innings refers to Innings_No = 2; average extra runs = divide(sum(Extra_Runs), count(Innings_No)) when Innings_No = 2
SELECT AVG(Innings_No) FROM Extra_Runs WHERE Innings_No = 2
soccer_2016
List the name of the players born between 1970 and 1990 in descending order of age.
name of the players refers to Player_Name; born between 1970 and 1990 refers to DOB between '1970-01-01' and '1990-12-31'
SELECT Player_Name FROM Player WHERE DOB BETWEEN '1970-01-01' AND '1990-12-31' ORDER BY DOB DESC
soccer_2016
From which country does the most umpires are from? How many of them are from the mentioned country?
which country refers to Country_Id; most umpires refers to max(count(Umpire_Id))
SELECT T2.Country_Id, COUNT(T1.Umpire_Id) FROM Umpire AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Umpire_Country GROUP BY T2.Country_Id ORDER BY COUNT(T1.Umpire_Id) DESC LIMIT 1
soccer_2016
In the players, how many were out by hit wicket?
out by hit wicket refers to Out_Name = 'hit wicket'
SELECT Player_Out FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE Out_Name = 'hit wicket'
soccer_2016
On average, how many players from each country bat with their right hand?
bat with their right hand refers to Batting_hand = 'Right-hand bat'; average = divide(count(Player_Id) when Batting_hand = 'Right-hand bat', count(Country_Name))
SELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Country_Name) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_id = T2.Batting_hand
soccer_2016
Which player became the man of the series in the year 2012? Give the name and country of this player.
year 2012 refers to Season_Year = 2012; name of player refers to Player_Name.; country of this player refers to Country_Name
SELECT T2.Player_Name, 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_Year = 2012
soccer_2016
Write the name of the player who was the man of the series more than one time.
name of the player refers to Player_Name; man of the series more than one time refers to count(Man_of_the_Series) > 1
SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Man_of_the_Series > 1
soccer_2016
What is the difference in the average number of players out by lbw and runout in the matches?
out by lbw refers to Out_Id = 4; runout refers to Out_Id = 3; average out by lbw refers to  avg(Player_Out when Out_Id = 4); average out by runout refers to  avg(Player_Out when Out_Id = 3)
SELECT AVG(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T2.Out_Name = 'lbw'
soccer_2016
Identify by their ID all the overs in which the player with ID 7 was on strike.
Identify by their ID all the overs refers to Over_Id; player with ID 7 was on strike refers to Striker = 7
SELECT DISTINCT Over_Id FROM Ball_by_Ball WHERE Striker = 7
soccer_2016
How many players are older than Gurkeerat Singh player?
older than Gurkeerat Singh player refers to DOB ! = 'Gurkeerat Singh' and DOB < '1990-06-29'
SELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh'
soccer_2016
Indicate the name of the most versatile players of the Delhi Daredevils.
if a player has multiple roles in a match, it means this player is versatile; name refers to Player_Name; most versatile player refers to MAX(COUNT(Role_id)); Delhi Daredevils refers to Team_Name = 'Delhi Daredevils'
SELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T2.Team_Name = 'Delhi Daredevils' GROUP BY T3.Player_Name ORDER BY COUNT(T1.Role_Id) DESC LIMIT 1
soccer_2016
What is the name of the player who has been chosen the most times for 'Man of the Series'?
name of the player refers to Player_Name; most times for 'Man of the Series' refers to max(count(Man_of_the_Match))
SELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) DESC LIMIT 1
soccer_2016
In what year did SP Narine win the Orange Cap?
year refers to Season_Year
SELECT T4.Season_Year, T4.Orange_Cap FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Season AS T4 ON T3.Season_Id = T4.Season_Id WHERE T1.Player_Name = 'SP Narine' GROUP BY T4.Season_Year, T4.Orange_Cap
soccer_2016
Which teams have had a player awarded the Purple Cap and another with the Orange Cap in the same season?
SELECT T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Season_Id = T2.Season_Id INNER JOIN Player_Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Player AS T4 ON T3.Player_Id = T4.Player_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id GROUP BY T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap
soccer_2016
List all Zimbabwean players.
Zimbabwean refers to Country_Name = 'Zimbabwea'; players refers to Player_Name
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'Zimbabwea'
soccer_2016
How many players bat with their left hands?
bat with their left hands refers to Batting_hand = 'Left-hand bat'
SELECT SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
soccer_2016
List the name of all New Zealand umpires.
New Zealand umpires refers to Country_Name = 'New Zealand'; name of umpires refers to Umpire_Name
SELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand'
soccer_2016
In which country do most players have the 'slow left-arm chinaman' bowling style?
'slow left-arm chinaman' bowling style refers to Bowling_skill = 'Slow left-arm chinaman'; most players  refers to max(count(Country_Id))
SELECT T3.Country_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Bowling_skill = 'Slow left-arm chinaman'
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
soccer_2016
In how many games in which the batting team was the Delhi Daredevils were no runs scored?
batting team was the Delhi Daredevils refers to Team_Name = 'Delhi Daredevils' and Team_1 = Team_Id where Team_Batting = 1 or Team_2 = Team_Id where Team_Batting = 2; no runs scored refers to Runs_Scored = 0
SELECT COUNT(T1.Runs_Scored) FROM Batsman_Scored AS T1 INNER JOIN Ball_by_Ball AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Team AS T4 ON T3.Team_1 = T4.Team_Id WHERE T2.Team_Batting = 1 OR T2.Team_Batting = 2 AND T4.Team_Name = 'Delhi Daredevils'
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'
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
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
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
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
soccer_2016
Among the South African players, how many were born before 4/11/1980?
South African players refers to Country_Name = 'South Africa'; born before 4/11/1980 refers to DOB < '1980-4-11'
SELECT SUM(CASE WHEN T1.DOB < '1980-4-11' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'South Africa'
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'
soccer_2016
Write down the player names and IDs of the English umpires.
English umpires refers to Country_Name = 'England'
SELECT T1.Umpire_Name, T1.Umpire_Id FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'England'
soccer_2016
Which year do the majority of the players were born?
year refers to DOB; majority of the players refers to max(count(Player_Id))
SELECT DOB FROM Player GROUP BY DOB ORDER BY COUNT(DOB) DESC LIMIT 1
soccer_2016
Who is the player who received the man of the match award during the last match of Season 9?
Who refers to Player_Name; last match of Season 9 refers to max(Match_Date) where Season_Id = 9
SELECT T1.Player_name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Season_Id = 9 ORDER BY T2.Match_Date DESC LIMIT 1
soccer_2016
What is the name of the team that won the first ever match?
name of the team refers to Team_Name; won the first ever match refers to Match_Winner where max(Match_Date)
SELECT T1.Team_Name FROM team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Season_Id = 1 ORDER BY T2.Match_Date LIMIT 1
soccer_2016
How many cities are in U.A.E?
U.A.E refers to Country_Name = 'U.A.E'
SELECT SUM(CASE WHEN T2.Country_Name = 'U.A.E' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN country AS T2 ON T1.Country_id = T2.Country_id
soccer_2016
List the names of all the umpires from England.
from England refers to Country_Name = 'England'
SELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T2.Country_Name = 'England'
soccer_2016
How many players bowl in the legbreak style?
legbreak style refers to Bowling_skill = 'Legbreak'
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_skill = 'Legbreak'
soccer_2016
Which country is umpire TH Wijewardene from?
country refers to Country_Name
SELECT T2.Country_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T1.Umpire_Name = 'TH Wijewardene'
soccer_2016
What are the names of the venues in Abu Dhabi?
names of the venues refers to Venue_Name; Abu Dhabi refers to City_Name = 'Abu Dhabi'
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T2.City_Name = 'Abu Dhabi'
soccer_2016
Which country is the youngest player from?
country refers to Country_Name; youngest player refers to max(DOB)
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name ORDER BY T2.DOB DESC LIMIT 1
soccer_2016
Provide the complete name of the venue, city and country where the last match was held.
name of the venue, city and country refers to Venue_Name and City_Name and Country_Name; last match refers to max(Match_Date)
SELECT T1.Venue_Name, T2.City_Name, T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id INNER JOIN Match AS T4 ON T1.Venue_Id = T4.Venue_Id ORDER BY T4.Match_Date DESC LIMIT 1
soccer_2016
How many overs were there in each innings of match ID "336011"?
SELECT SUM(CASE WHEN Innings_No = 1 THEN 1 ELSE 0 END) AS IN1 , SUM(CASE WHEN Innings_No = 2 THEN 1 ELSE 0 END) AS IN2 FROM Ball_by_Ball WHERE Match_Id = 336011
soccer_2016
List the ball IDs, scores, and innings numbers in the over ID 20 of match ID "335988".
innings numbers refers to Innings_No
SELECT Ball_Id, Runs_Scored, Innings_No FROM Batsman_Scored WHERE Match_Id = 335988 AND Over_Id = 20
soccer_2016
How many matches did Mohammad Hafeez play?
Mohammad Hafeez refers to Player_Name = 'Mohammad Hafeez';
SELECT SUM(CASE WHEN T2.Player_Name = 'Mohammad Hafeez' THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id
soccer_2016
What is the ratio of players with batting hands of left and right?
batting hands of left refers to Batting_hand = 'Left-hand bat'; right refers to Batting_hand = 2; ratio refers to DIVIDE(COUNT(Batting_hand = 'Right-hand bat'), COUNT(Batting_hand = 2))
SELECT CAST(SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
soccer_2016
Who is the eldest player and where did he/she come from?
eldest player refers to MIN(DOB); where he/she come from refers to Country_Name
SELECT T1.Player_Name, T2.Country_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id ORDER BY T1.DOB LIMIT 1
soccer_2016
Which bowling skills did the players from Zimbabwea have?
Zimbabwea refers to Country_Name = 'Zimbabwea';
SELECT T1.Bowling_skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'Zimbabwea'
soccer_2016
List the IDs and names of the umpires from New Zealand.
New Zealand refers to Country_Name = 'New Zealand'; ID of the umpire refers to Umpire_Id; name of the umpire refers to Umpire_Name
SELECT T1.Umpire_Id, T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand'
soccer_2016
Who was the captain-keeper of Rising Pune Supergiants?
captain-keeper refers to Role_Desc = 'CaptainKeeper'; Rising Pune Supergiants refers to Role_Desc = 'CaptainKeeper'
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Team AS T3 ON T2.Team_Id = T3.Team_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id WHERE T3.Team_Name = 'Rising Pune Supergiants' AND T4.Role_Desc = 'CaptainKeeper' GROUP BY T1.Player_Name
soccer_2016
Provide match ID which had the extra type of penalty.
extra type of penalty refers to Extra_Name = 'penalty';
SELECT T1.Match_Id FROM Extra_Runs AS T1 INNER JOIN Extra_Type AS T2 ON T1.Extra_Type_Id = T2.Extra_Id WHERE T2.Extra_Name = 'penalty'
soccer_2016
Calculate the average players out in the first innings per match. How many of them were out by the leg before wicket?
out by the leg refers to Out_Name = 'lbw'; out in the first innings refers to Innings_No = 2;
SELECT CAST(COUNT(T1.Player_Out) AS REAL) / COUNT(T1.Match_Id), SUM(CASE WHEN T2.Out_Name = 'lbw' THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T1.Innings_No = 2
soccer_2016
Count the matches with a total of two innings.
total of two innings refers to innings_no = 2;
SELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2
soccer_2016
Which is the country of the city named "Rajkot"?
city named "Rajkot" refers to city_name = 'Rajkot';
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot'
soccer_2016
What are the teams that played in a match with the point of winning margin of 38 on April 30, 2009?
point of winning margin of 38 refers to win_margin = 38; on April 30, 2009 refers to match_date = '2009-04-30'; team refers to Team_Name;
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 WHERE T2.win_margin = 38 AND match_date = '2009-04-30'
soccer_2016
Give the name of the team of T Kohli in the match ID 335989.
team of T Kohli refers to player_name = 'T Kohli';
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T2.match_id = 335989 AND T3.player_name = 'T Kohli'
soccer_2016
How many venues are located at Centurion, South Africa?
venues are located at Centurion refers to city_name = 'Centurion'; South Africa refers to country_name = 'South Africa'
SELECT COUNT(T1.Venue_name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id WHERE T3.country_name = 'South Africa' AND T2.city_name = 'Centurion'
soccer_2016
How many times did K Goel played as a player only?
K Goel refers to Player_Name = 'K Goel'; played as a player only refers to Role_Id = 3
SELECT COUNT(T1.Match_Id) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'K Goel' AND T3.Role_Id = 3
soccer_2016
What is the average winning margin of the matches held in Newlands?
average winning margin refers to avg(win_margin); held in Newlands refers to venue_name = 'Newlands'
SELECT AVG(T1.win_margin) FROM Match AS T1 INNER JOIN Venue AS T2 ON T1.venue_id = T2.venue_id WHERE T2.venue_name = 'Newlands'
soccer_2016
Provide the losing team's name in the match ID 336039.
losing team's name refers to Team_Id NOT in "match_winner" column
SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT CASE WHEN Team_1 = Match_Winner THEN Team_2 ELSE Team_1 END FROM Match WHERE match_id = 336039 )
soccer_2016
What is the venue for the match ID 829768?
venue refers to Venue_Name
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T2.match_id = 829768
soccer_2016
What is the second team's name in the match with the lowest winning margin?
lowest winning margin refers to MIN(win_margin); team name refers to team_name; second team refers to team_2
SELECT T1.team_name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.team_2 ORDER BY T2.win_margin LIMIT 1
soccer_2016
What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles?
SC Ganguly refers to Player_Name = 'SC Ganguly'; played as a Captain refers to Role_Id = 1; played other roles refers to Role_Id > 1; difference refers to SUBTRACT(COUNT(Role_Id = 1), COUNT(Role_Id > 1))
SELECT SUM(CASE WHEN T3.Role_Id = 1 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.Role_Id > 1 THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'SC Ganguly'
soccer_2016
How many players have the bowling skill greater than 2?
bowling skill greater than 2 refers to Bowling_skill > 2
SELECT COUNT(Player_Name) FROM Player WHERE Bowling_skill > 2
soccer_2016
What is the city name of country ID 3?
SELECT City_Name FROM City WHERE Country_ID = 3
soccer_2016
Provide the country ID of East London.
East London refers to City_Name = 'East London'
SELECT Country_id FROM City WHERE City_Name = 'East London'
soccer_2016
List the names of players who play by the left hand.
play by the left hand refers to Batting_hand =   'Left-hand bat'
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_hand = 'Left-hand bat'
soccer_2016
How many players are Indians?
are Indians refers to Country_Name = 'India'
SELECT COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'India'
soccer_2016
List the name of England players.
England players refers to Country_Name = 'England'
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'England'
soccer_2016
What is the venue name of Bandladore?
Bandladore refers to City_Name = 'Bangalore'
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_ID = T2.City_ID WHERE T2.City_Name = 'Bangalore'
soccer_2016
What are the names of players who participated in season year 2008?
season year 2008 refers to Season_Year = 2008
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008 GROUP BY T1.Player_Name
soccer_2016
What are the names of players that have run scored less than 3?
scored less than 3 refers to Runs_Scored < 3; name of player refers to Player_name;
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Batsman_Scored AS T3 ON T2.Match_ID = T3.Match_ID WHERE T3.Runs_Scored < 3 GROUP BY T1.Player_Name
soccer_2016
What is the role of SC Ganguly?
SC Ganguly refers to Player_Name = 'SC Ganguly'; role refers to Role_Desc
SELECT T3.Role_Desc 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' GROUP BY T3.Role_Desc
soccer_2016
List the names of players who played as a keeper.
played as a keeper refers to Role_Desc = 'Keeper'; name of player refers to Player_Name;
SELECT T1.Player_Name 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 T3.Role_Desc = 'Keeper' GROUP BY T1.Player_Name
soccer_2016
What are the names of players in team 1?
in team 1 refers to Team_Id = 1; name of player refers to Player_Name;
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Team AS T3 ON T2.Team_Id = T3.Team_Id WHERE T3.Team_Id = 1 GROUP BY T1.Player_Name
soccer_2016
Which teams did SC Ganguly join in season year 2008?
SC Ganguly refers to Player_Name = 'SC Ganguly'; in season year 2008 refers to Season_Year = 2008
SELECT T5.Team_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id WHERE T4.Season_Year = 2008 AND T1.Player_Name = 'SC Ganguly' GROUP BY T5.Team_Name
soccer_2016
What type did match ID 336000 win?
type of match won refers to Win_Type
SELECT T2.Win_Type FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T1.Match_Id = 336000
soccer_2016
Where did SB Joshi come from?
SB Joshi refers to Player_Name = 'SB Joshi'; where the player come from refers to Country_Name
SELECT T2.Country_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T1.Player_Name = 'SB Joshi'
soccer_2016
How many players have left arm fast in bowling skill?
have left arm fast in bowling skill refers to Bowling_skill = 'Left-arm fast';
SELECT COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_skill = 'Left-arm fast'
soccer_2016
What is the outcome type of match ID 392195?
SELECT T2.Outcome_Type FROM Match AS T1 INNER JOIN Outcome AS T2 ON T1.Outcome_type = T2.Outcome_Id WHERE T1.Match_Id = '392195'
soccer_2016
Who is the youngest player and which city did he/she come from?
youngest player refers to MIN(DOB); city refers to City_Name
SELECT T3.City_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id INNER JOIN City AS T3 ON T2.Country_Id = T3.Country_Id ORDER BY T1.DOB LIMIT 1
soccer_2016
How many matches did team Kings XI Punjab win in season year 2008?
in season year 2008 refers to Season_Year = 2008; team Kings XI Punjab refers to Team_Name = 'Kings XI Punjab'
SELECT COUNT(DISTINCT T2.Match_Id) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Kings XI Punjab' AND T4.Season_Year = 2008
soccer_2016
How many seasons did Pune Warriors participate in?
Pune Warriors refers to Team_Name = 'Pune Warriors'
SELECT COUNT(T.Season_Year) FROM ( SELECT T4.Season_Year FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Pune Warriors' GROUP BY T4.Season_Year ) T
soccer_2016
What year was R Dravid born and the role he played?
R Dravid refers to Player_Name = 'R Dravid'; year born refers to DOB; role refers to Role_Desc
SELECT T1.DOB, T3.Role_Desc 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 = 'R Dravid' GROUP BY T1.DOB, T3.Role_Desc
soccer_2016
How many times did SC Ganguly be the man of the match?
SC Ganguly refers to Player_Name = 'SC Ganguly'
SELECT COUNT(T2.Man_of_the_Match) FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id WHERE T1.Player_Name = 'SC Ganguly'
soccer_2016
Which team won by wickets in match ID 335993?
team refers to Team_Name
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Win_By AS T4 ON T2.Win_Type = T4.Win_Id WHERE T2.Match_Id = '335993' GROUP BY T1.Team_Name
soccer_2016
Count the matches that were won by wickets in all season.
won by wickets refers to Win_type = 'wickets';
SELECT COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_type = 'wickets'
soccer_2016
Calculate the percentage of left hand batting style players among all players.
left hand batting style players refers to Batting_hand = 'Left-hand bat'; percentage refers to DIVIDE(COUNT(Batting_hand = 'Left-hand bat'), COUNT(Player_Id)) * 100.0
SELECT CAST(SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
soccer_2016
What is the percentage of matches that are won by runs?
won by runs refers to win_type = 1; percentage refers to DIVIDE(COUNT(win_type = 1), COUNT(Win_Type)) * 100
SELECT CAST(SUM(CASE WHEN T1.win_type = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Win_Type) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
soccer_2016
How many matches have 7 points of winning margin?
have 7 points of winning margin refers to win_margin = 7;
SELECT COUNT(Match_Id) FROM Match WHERE win_margin = 7
soccer_2016
Who is the winning team in a match held on April 26, 2009 with a winning margin of 6 points?
winning margin of 6 points refers to Win_Margin = 6; held on April 26, 2009 refers to Match_Date = '2009-04-26'
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner WHERE T2.Win_Margin = 6 AND T2.Match_Date = '2009-04-26'
soccer_2016
In the match ID 419135, who won by runs?
who refers to Team_Name
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Win_By AS T3 ON T2.win_type = T3.win_id WHERE T2.Match_Id = 419135
soccer_2016
Among the matches held in St. George's Park, give the match ID of the match with the highest winning margin points.
held in St. George's Park refers to Venue_Name = 'St George''s Park'; highest winning margin points refers to MAX(Win_Margin)
SELECT T2.Match_Id FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T1.Venue_Name = 'St George''s Park' ORDER BY T2.Win_Margin DESC LIMIT 1
soccer_2016
How many of the players are from Sri Lanka?
from Sri Lanka refers to Country_Name = 'Sri Lanka';
SELECT COUNT(*) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'Sri Lanka'
soccer_2016
List the player's name who played as a captain.
played as a captain refers to Role_Desc = 'captain'; player refers to Player_Name
SELECT T2.Player_Name FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T3.Role_Desc = 'Captain' GROUP BY T2.Player_Name
soccer_2016
Give the match's venue and winning team for the match ID 392194.
venue refers to Venue_Name; winning team refers to match_winner
SELECT T1.Venue_Name, T3.Team_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id INNER JOIN Team AS T3 ON T2.match_winner = T3.Team_Id WHERE T2.Match_Id = 392194
soccer_2016
Among the matches of Delhi Daredevils in 2009, what is the percentage of their matches won by wickets?
Delhi Daredevils refers to team_name = 'Delhi Daredevils'; in 2009 refers to Match_Date = '2009%'; won by wickets refers to Win_Type = 'wickets'; percentage refers to DIVIDE(COUNT(Win_Type = 'wickets'), COUNT(Win_Type))
SELECT CAST(SUM(CASE WHEN T3.Win_Type = 'wickets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Win_Type) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE T1.Team_Name = 'Delhi Daredevils'
music_tracker
How many times was the album released by blowfly in 1980 downloaded?
blowfly is an artist; groupYear = 1980; album refers to releaseType; downloaded refers to totalSnatched;
SELECT totalSnatched FROM torrents WHERE artist LIKE 'blowfly' AND groupYear = 1980
music_tracker
What is the tag of the album with the highest amount of downloads?
album refers to releaseType; the highest amount of downloads refers to MAX(totalSnatched);
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 1
music_tracker
What are the top 5 tags with the highest amount of downloads?
the highest amount of downloads refers to MAX(totalSnatched);
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 5
music_tracker
What is the release title of the single under the "funk" tag that was released the oldest?
release title of single refers to groupName where releaseType = 'single'; the oldest means coming before all others in time and refers to MIN(groupYear);
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'funk' AND T1.releaseType = 'single' ORDER BY T1.groupYear LIMIT 1
music_tracker
Name all the release titles of the "ep's" under the alternative tag.
release titles of the "ep's" refer to groupName where releaseType = 'ep';
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'alternative' AND T1.releaseType = 'ep'
music_tracker
What are the tags of the top 5 least downloaded live albums?
least downloaded album refers to MIN(totalSnatched where releaseType = 'album');
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched LIMIT 5
music_tracker
What is the tag and the artist of the most downloaded single?
the most downloaded single refers to MAX(totalSnatched where releaseType = 'single');
SELECT T2.tag, T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' ORDER BY T1.totalSnatched DESC LIMIT 1