db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 0
673
| SQL
stringlengths 23
804
| question_id
int64 0
9.43k
| difficulty
stringclasses 1
value |
---|---|---|---|---|---|
soccer_2016
|
What percentage of players have Legbreak skill?
|
Legbreak skill refers to Bowling_skill = 'Legbreak' ; percentage = divide(sum(Player_Id) when Bowling_skill = 'Legbreak', count(Player_Id)) as percentage
|
SELECT CAST(SUM(CASE WHEN T2.Bowling_skill = ' Legbreak' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id
| 1,900 | |
soccer_2016
|
In the matches where the winning margin is less than fifty, how many teams won by wicket?
|
winning margin is less than fifty refers to Win_Margin < 50; won by wicket refers to Win_Type = 'wickets'
|
SELECT COUNT(T2.Win_Id) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50
| 1,901 | |
soccer_2016
|
In how many venues did team 2 win the toss and lose the match?
|
team 2 win the toss refers to Toss_Winner = Team_2 ; lose the match refers to Match_Winner = Team_1
|
SELECT SUM(CASE WHEN T1.Team_2 = T1.Match_Winner THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Team_1 = T1.Toss_Winner
| 1,902 | |
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
| 1,903 | |
soccer_2016
|
Give the name of the venue where the most number of matches are held.
|
name of the venue refers to Venue_Name; most number of matches refers to max(count(Venue_Id))
|
SELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id GROUP BY T2.Venue_Name ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1
| 1,904 | |
soccer_2016
|
Which city hosted the least number of no-result matches?
|
city refers to City_Name; no-result matches refers to Win_type = 'NoResult'; least number refers to min(count(Win_type = 'NoResult'))
|
SELECT T4.City_Name FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Venue AS T3 ON T1.Venue_Id = T3.Venue_Id INNER JOIN City AS T4 ON T3.City_Id = T4.City_Id WHERE T2.Win_Type = 'NO Result' GROUP BY T4.City_Id ORDER BY COUNT(T2.Win_Type) ASC LIMIT 1
| 1,905 | |
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
| 1,906 | |
soccer_2016
|
List the name and country of the players who got more than average catches in ascending order of the number of catches.
|
name and country of the players refers to Player_Name and Country_Name; catches refers to Out_name = 'caught'; average catches refers to divide(count(Player_ID) when Out_name = 'caught', sum(Player_ID))
|
SELECT T1.Player_Name, T4.Country_Name FROM Player AS T1 INNER JOIN Wicket_Taken AS T2 ON T1.Player_Id = T2.Fielders INNER JOIN Out_Type AS T3 ON T2.Kind_Out = T3.Out_Id INNER JOIN Country AS T4 ON T1.Country_Name = T4.Country_Id GROUP BY T1.Player_Name ORDER BY COUNT(T3.Out_Name) ASC
| 1,907 | |
soccer_2016
|
Of the matches that were won by runs by team 1, what percentage have team 1 won the toss and decided to field?
|
won by runs refers to Win_Type = 'runs'; won the toss and decided to field refers to Toss_Winner and Toss_Name = 'field'; percentage = divide(count(Team_1) when Match_Winner = Team_1 and Toss_Winner = Team_1, count(Team_1)) as percentage
|
SELECT CAST(COUNT(CASE WHEN T1.Team_1 = T1.Match_Winner = T1.Toss_Winner THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Team_1) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Toss_Decision AS T3 ON T1.Toss_Decide = T3.Toss_Id WHERE T3.Toss_Name = 'field' AND T2.Win_Type = 'runs'
| 1,908 | |
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'
| 1,909 | |
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
| 1,910 | |
soccer_2016
|
How many first teams chose to bat after winning the toss?
|
first teams refers to Team_1; chose to bat after winning the toss refers to Toss_Winner and Toss_Decide = 2
|
SELECT COUNT(Team_1) FROM `Match` WHERE Team_1 = Toss_Winner AND Toss_Decide = 2
| 1,911 | |
soccer_2016
|
How many games were played in March 2010?
|
were played in March 2010 refers to Match_Date = '2010-03%'
|
SELECT SUM(CASE WHEN Match_Date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `Match`
| 1,912 | |
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'
| 1,913 | |
soccer_2016
|
How many times has SR Watson been named 'Man of the Match'?
|
SELECT SUM(CASE WHEN T2.Player_Name = 'SR Watson' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id
| 1,914 | ||
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
| 1,915 | |
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
| 1,916 | |
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
| 1,917 | |
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
| 1,918 | ||
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'
| 1,919 | |
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
| 1,920 | |
soccer_2016
|
How many games were not won by runs?
|
not won by runs refers to Win_Type ! = 'runs'
|
SELECT SUM(CASE WHEN T2.Win_Type != 'runs' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
| 1,921 | |
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'
| 1,922 | |
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'
| 1,923 | |
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
| 1,924 | |
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'
| 1,925 | |
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'
| 1,926 | |
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'
| 1,927 | |
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
| 1,928 | |
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
| 1,929 | |
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
| 1,930 | |
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
| 1,931 | |
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
| 1,932 | |
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
| 1,933 | |
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'
| 1,934 | |
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'
| 1,935 | |
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'
| 1,936 | |
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'
| 1,937 | |
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'
| 1,938 | |
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'
| 1,939 | |
soccer_2016
|
When and for what role did the youngest player appear in his first match?
|
When refers to Match_Date; youngest player refers to max(DOB); first match refers to min(Match_Date)
|
SELECT T1.Match_Date, T4.Role_Desc FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id ORDER BY T3.DOB DESC LIMIT 1
| 1,940 | |
soccer_2016
|
Tally the match IDs in which V Kohli is the "Man of the Match".
|
SELECT T1.Match_Id FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id WHERE T2.Player_Name = 'V Kohli'
| 1,941 | ||
soccer_2016
|
From 2011 to 2012, how many Australian players became the "Man of the Match"?
|
From 2011 to 2012 refers to Match_Date between '2011%' and '2012%'; Australian players refers to Country_Name = 'Australia'
|
SELECT SUM(CASE WHEN T1.Match_Date BETWEEN '2011%' AND '2012%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_Name WHERE T3.Country_Name = 'Australia'
| 1,942 | |
soccer_2016
|
Who among the players won both "Man of the Series" and "Orange Cap" in the same season?
|
Who refers to Player_Name;
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Man_of_the_Series = T2.Orange_Cap
| 1,943 | |
soccer_2016
|
When did the Sunrisers Hyderabad win their first match?
|
Sunrisers Hyderabad refers to Team_Name = 'Sunrisers Hyderabad'; win their first match refers to Match_Winner and min(Match_Date)
|
SELECT T1.Match_Date FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'
| 1,944 | |
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'
| 1,945 | |
soccer_2016
|
Calculate the run rate at the end of 17 overs of the match ID 335987 on 4/18/2008.
|
4/18/2008 refers to Match_Date = 4/18/2008; end of 17 overs refers to count(Toss_Name = 'field' ) = 17; run rate = divide(sum(Runs_Scored) when Toss_Name = 'bat', sum(Over_Id) when Toss_Name = 'field')
|
SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 17
| 1,946 | |
soccer_2016
|
Compute the run rate at the end of 16 overs of the match ID 335999. Please include the name of the "Man of_the Match".
|
end of 16 overs refers to count(Toss_Name = 'field' ) = 16; run rate = divide(count(Runs_Scored) when Toss_Name = 'bat', sum(Over_Id)when Toss_Name = 'field'); name refers to Player_Name
|
SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 16
| 1,947 | |
soccer_2016
|
What is the id of the team with the highest number of matches won?
|
id of the team refers to Team_Id; highest number of matches won refers to max(count(Match_Winner))
|
SELECT Match_Id FROM `Match` ORDER BY Match_Winner DESC LIMIT 1
| 1,948 | |
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
| 1,949 | |
soccer_2016
|
What is the date of the match that has the highest wager on the final result of a game?
|
date of the match refers to Match_Date; highest wager refers to max(Win_Margin)
|
SELECT Match_Date FROM `Match` ORDER BY Win_Margin DESC LIMIT 1
| 1,950 | |
soccer_2016
|
Which season has the fewest number of matches?
|
fewest number of matches refers to min(count(Match_Id))
|
SELECT Season_Id FROM `Match` GROUP BY Season_Id ORDER BY COUNT(Match_Id) LIMIT 1
| 1,951 | |
soccer_2016
|
How many players have won at least 5 man of the match awards?
|
won at least 5 man of the match awards refers to COUNT(Match_Id) > = 5
|
SELECT COUNT(Match_Id) FROM `Match` GROUP BY Man_of_the_Match HAVING COUNT(Match_Id) >= 5
| 1,952 | |
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
| 1,953 | |
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
| 1,954 | |
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
| 1,955 | |
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'
| 1,956 | |
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'
| 1,957 | |
soccer_2016
|
How many matches did Rajasthan Royals play in Season 8?
|
Season 8 refers to Season_Id = 8
|
SELECT SUM(CASE WHEN T1.Season_Id = 8 THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Rajasthan Royals'
| 1,958 | |
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'
| 1,959 | |
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'
| 1,960 | |
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
| 1,961 | |
soccer_2016
|
List all the names of the winning team's players in the first match of season 1.
|
names refers to Player_Name; winning team's refers to Match_Winner; first match of season 1 refers to Season_Id = 1 and min(Match_Date)
|
SELECT T3.Player_Name FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Winner = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T1.Season_Id = 1 ORDER BY T1.Match_Date LIMIT 1
| 1,962 | |
soccer_2016
|
Who is the youngest player to have won the Purple Cap?
|
Who refers to Player_Name; youngest player to have won the Purple Cap refers to min(subtract(Season_Year, DOB))
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Purple_Cap ORDER BY T2.Season_Year - SUBSTR(T1.DOB, 1, 4) LIMIT 1
| 1,963 | |
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
| 1,964 | |
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
| 1,965 | ||
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
| 1,966 | |
soccer_2016
|
How many matches were held in 2011?
|
held in 2011 refers to Match_Date like '2011%';
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2011%'
| 1,967 | |
soccer_2016
|
How old is Ishan Kishan in 2022?
|
old refers to SUBTRACT(2022, SUBSTR(DOB, 1, 4)); Ishan Kishan refers to Player_Name = 'Ishan Kishan';
|
SELECT 2022 - SUBSTR(DOB, 1, 4) FROM Player WHERE Player_Name = 'Ishan Kishan'
| 1,968 | |
soccer_2016
|
Calculate the win rate of the toss-winners in 2012.
|
in 2012 refers to Match_Date like '2012%'; win rate refers to DIVIDE(COUNT(Toss_Winner = Match_Winner), COUNT(Match_Date like '2012%'))
|
SELECT CAST(SUM(CASE WHEN Toss_Winner = Match_Winner THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN Match_Date LIKE '2012%' THEN 1 ELSE 0 END) FROM `Match`
| 1,969 | |
soccer_2016
|
How many matches in 2009 had win margins of less than 10?
|
in 2009 refers to Match_Date like '2009%'; win margins of less than 10 refers to Win_Margin < 10;
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2009%' AND Win_Margin < 10
| 1,970 | |
soccer_2016
|
Provide the players' names in both teams of the match that was held in June 2014.
|
held in June 2014 refers to SUBSTR(Match_Date, 7, 1) = 6 and SUBSTR(Match_Date, 1, 4) = 2014
|
SELECT T1.Player_Name 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 SUBSTR(T3.Match_Date, 1, 4) = '2014' AND SUBSTR(T3.Match_Date, 7, 1) = '6' LIMIT 2
| 1,971 | |
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
| 1,972 | |
soccer_2016
|
Among the players from South Africa, provide the players' names who were born in 1984.
|
from South Africa refers to Country_Name = 'South Africa'; born in 1984 refers to DOB like '1984%';
|
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'South Africa' AND T1.DOB LIKE '1984%'
| 1,973 | |
soccer_2016
|
Among the" Mumbai Indians" team that played in 2009, how many percent of the matches did they win?
|
played in 2009 Match_Date like '2009%'; Mumbai Indians" team refers to Team_Name = 'Mumbai Indians'; percent of the matches did they win refers to DIVIDE(COUNT(Match_Winner = Team_Id), COUNT(Match_Id))
|
SELECT CAST(SUM(CASE WHEN T1.Match_Winner = T2.Team_Id THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Mumbai Indians' AND T1.Match_Date LIKE '2009%'
| 1,974 | |
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
| 1,975 | |
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
| 1,976 | |
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'
| 1,977 | |
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'
| 1,978 | |
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
| 1,979 | |
soccer_2016
|
How many matches did the Sunrisers Hyderabad team win in 2013?
|
Sunrisers Hyderabad team refers to Team_Name = 'Sunrisers Hyderabad'; in 2013 refers to Match_Date like '2013%';
|
SELECT SUM(CASE WHEN Match_Date LIKE '2013%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'
| 1,980 | |
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'
| 1,981 | |
soccer_2016
|
Name the teams played in a match which resulted in a tie in 2015.
|
resulted in a tie refers to Win_Type = 'Tie'; in 2015 refers to SUBSTR(Match_Date, 1, 4) = 2015
|
SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 OR T1.Team_Id = T2.Team_2 INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE SUBSTR(T2.Match_Date, 1, 4) = '2015' AND T3.Win_Type = 'Tie' LIMIT 1
| 1,982 | |
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
| 1,983 | |
soccer_2016
|
How many matches are there in 2008?
|
in 2008 refers to Match_Date like '2008%'
|
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2008%'
| 1,984 | |
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
| 1,985 | |
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'
| 1,986 | |
soccer_2016
|
How many of the matches are Superover?
|
are Superover refers to win_type = 'wickets';
|
SELECT SUM(CASE WHEN T2.win_type = 'wickets' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
| 1,987 | |
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'
| 1,988 | |
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'
| 1,989 | |
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'
| 1,990 | |
soccer_2016
|
Among the matches of Delhi Daredevils in 2014, how many won matches are there?
|
Delhi Daredevils refers to team_name = 'Delhi Daredevils'; in 2014 refers to Match_Date contains '2014';
|
SELECT COUNT(T1.Match_Winner) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 OR T2.Team_Id = T1.Team_2 WHERE T2.team_name = 'Delhi Daredevils' AND T1.Match_Date LIKE '2014%'
| 1,991 | |
soccer_2016
|
Among the matches played by Royal Challengers Bangalore, what is the match ID of the match with the highest winning margin?
|
Royal Challengers Bangalore refers to team_name = 'Royal Challengers Bangalore'; highest winning margin refers to MAX(win_margin)
|
SELECT T2.match_id FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner WHERE T1.team_name = 'Royal Challengers Bangalore' AND T2.match_date LIKE '2012%' ORDER BY T2.win_margin DESC LIMIT 1
| 1,992 | |
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
| 1,993 | |
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'
| 1,994 | |
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 )
| 1,995 | |
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
| 1,996 | |
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
| 1,997 | |
soccer_2016
|
Among the matches in 2013, what is the percentage of winning of the team "Mumbai Indians"?
|
in 2013 refers to Match_Date like '2013%'; winning of the team "Mumbai Indians" refers to Match_Winner = 7; percentage refers to DIVIDE(COUNT(Match_Winner = 7), COUNT(Match_Winner))
|
SELECT CAST(SUM(CASE WHEN T2.Match_Winner = 7 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Match_Winner) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date LIKE '2013%'
| 1,998 | |
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'
| 1,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.