Chinastark/bird_dataset huggingface dataset:
Database: soccer_2016
Question: Which venue did Kolkata Knight Riders play most of their matches as a Team 1?
Evidence: 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
SQL: 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
Database: soccer_2016
Question: Which team has the highest number of losses of all time?
Evidence: 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)))
SQL: 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
Database: soccer_2016
Question: Who is the player who won the first ever "man of the match" award?
Evidence: name of the player refers to Player_Name; the first ever refers to min(match_date); "man of the match" award refers to Player_Id in 'Man_of_the_Match'
SQL: SELECT Player_Name FROM Player WHERE Player_Id = ( SELECT Man_of_the_Match FROM `Match` ORDER BY match_date ASC LIMIT 1 )
Database: soccer_2016
Question: When did Chennai Super Kings play its first match?
Evidence: match date refers to Match_Date; Chennai Super Kings refers to Team_Name = 'Chennai Super Kings'; first match refers to min(Match_Date)
SQL: SELECT Match_Date FROM `Match` WHERE team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Chennai Super Kings' ) OR Team_2 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Chennai Super Kings' ) ORDER BY Match_Date ASC LIMIT 1
Database: soccer_2016
Question: How many players with left-hand batting style are from India?
Evidence: left-hand batting style refers to Batting_hand = 'Left-hand bat'; India refers to Country_Name = 'India'
SQL: 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'
Database: soccer_2016
Question: Who is the player that has the highest number of roles as a captain for Deccan Chargers?
Evidence: 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'
SQL: 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
Database: soccer_2016
Question: What is the percentage of all right-handed batting players among all the other players?
Evidence: 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%
SQL: 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
Database: soccer_2016
Question: Name the player who is born on July 7, 1981.
Evidence: name of the player refers to Player_Name; born on July 7 1981 refers to DOB = '1981-07-07'
SQL: SELECT Player_name FROM Player WHERE DOB = '1981-07-07'
Database: soccer_2016
Question: How many matches were played by the player with player ID 2?
Evidence: player ID 2 refers to Player_Id = 2
SQL: SELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match
Database: soccer_2016
Question: List the first team's name in the match with the highest winning margin.
Evidence: team's name refers to Team_Name; first team refers to Team_Id = Team_1; the highest winning margin refers to max(Win_Margin)
SQL: 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
Database: soccer_2016
Question: Give the country where St. George's Park is located.
Evidence: country refers to Country_Name; St. George's Park refers to Venue_Name = 'St George''s Park'
SQL: 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'
Database: soccer_2016
Question: List the player's name of Mumbai Indians in the match ID 335990.
Evidence: Mumbai Indians refers to Team_Name = 'Mumbai Indians'; match ID 335990 refers to Match_Id = 335990
SQL: 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
Database: soccer_2016
Question: Provide the winning team's name in the match with the point of winning margin of 7 on May 7, 2009.
Evidence: 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'
SQL: 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
Database: soccer_2016
Question: How many of the matches are Superover?
Evidence: Superover refers to Outcome_Type = 'Superover'
SQL: 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
Database: soccer_2016
Question: List the cities located in U.A.E.
Evidence: city refers to City_Name; U.A.E refers to Country_Name = 'U.A.E'
SQL: 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'
Database: soccer_2016
Question: What is the total number of won matches of the team named "Pune Warriors"?
Evidence: 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)
SQL: 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
Database: soccer_2016
Question: Among the matches held in 2015, who is the winning team in the match ID 829768?
Evidence: in 2015 refers to Match_Date LIKE '2015%'; the winning team refers to Team_Id = Match_Winner; match ID 829768 refers to Match_Id = 829768
SQL: SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Date LIKE '2015%' AND T1.Match_Id = 829768
Database: soccer_2016
Question: What is the role of K Goel in the match ID 335992?
Evidence: role refers to Role_Desc; K Goel refers to Player_Name = 'K Goel'; match ID 335992 refers to Match_Id = 335992
SQL: 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'
Database: soccer_2016
Question: How many cities are located in South Africa?
Evidence: South Africa refers to Country_Name = 'South Africa'
SQL: 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
Database: soccer_2016
Question: How many matches were held at the venue named "Newlands"?
Evidence: the venue named "Newlands" refers to Venue_Name = 'Newlands'
SQL: 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
Database: soccer_2016
Question: Provide the point of the winning margin in a match between Mumbai Indians and Royal Challengers Bangalore on May 28, 2008.
Evidence: 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'
SQL: 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')
Database: soccer_2016
Question: List the names of the first andthe second teams that played a match with the point of the winning margin lower than the 30% of the average winning margin of the matches held in 2011.
Evidence: name of the team refers to Team_Name; in 2011 refers to Match_Date LIKE '2011%'; the point of winning margin lower than 30% of the average winning margin refers to Win_Margin < multiply(avg(Win_Margin), 0.3) where Match_Date LIKE '2011%'
SQL: SELECT DISTINCT CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T2.Team_Name END, CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T3.Team_Name END 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 T1.Match_Date LIKE '2011%'
Database: soccer_2016
Question: Among the players born in 1977, what is the percentage of the players with a role as a captain?
Evidence: born in 1977 refers to DOB LIKE '1977%'; a role as a captain refers to Role_Desc = 'Captain'; percentage = divide(count(Role_Id where Role_Desc = 'Captain'), count(Role_Id)) * 100% where DOB LIKE '1977%'
SQL: SELECT CAST(SUM(CASE WHEN T1.Role_Desc = 'Captain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Role_Id) FROM Rolee AS T1 INNER JOIN Player_Match AS T2 ON T2.Role_Id = T1.Role_Id INNER JOIN Player AS T3 ON T3.Player_Id = T2.Player_Id WHERE T3.DOB LIKE '1977%'
Database: soccer_2016
Question: How many overs were there in the first innings of match ID "335996"?
Evidence: the first innings refers to Innings_No = 1; match ID "335996" refers to Match_Id = 335996
SQL: SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1
Database: soccer_2016
Question: List the over IDs, ball IDs, and innings numbers of the match ID "336004" while the batsman got the maximum scores.
Evidence: 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)
SQL: SELECT Over_Id, Ball_Id, Innings_No FROM Batsman_Scored WHERE Match_Id = 336004 ORDER BY Runs_Scored DESC LIMIT 1
Database: soccer_2016
Question: Describe any five matches IDs that reached over ID 20.
Evidence: reached over ID 20 refers to Over_Id = 20
SQL: SELECT Match_Id FROM Ball_by_Ball WHERE Over_Id = 20 GROUP BY Match_Id LIMIT 5
Database: soccer_2016
Question: How many players got out in the first inning of match ID "548335"?
Evidence: got out refers to Player_Out; the first inning refers to Innings_No = 1; match ID "548335" refers to Match_Id = 548335
SQL: SELECT SUM(CASE WHEN Match_Id = 548335 THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Innings_No = 1
Database: soccer_2016
Question: List the players' names who were born in 1971.
Evidence: players' name refers to Player_name; born in 1971 refers to DOB LIKE '1971%'
SQL: SELECT Player_name FROM Player WHERE DOB LIKE '1971%'
Database: soccer_2016
Question: Provide the match IDs which were held on 18th April 2015.
Evidence: on 18th April 2015 refers to DATE(Match_Date) = '2015-04-18'
SQL: SELECT Match_Id FROM Match WHERE Match_Date LIKE '%2015-04-18%'
Database: soccer_2016
Question: List the match IDs which had players out by hit wickets.
Evidence: had players out by hit wickets refers to Out_Name = 'hit wicket'
SQL: 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'
Database: soccer_2016
Question: How many players got out by being stumped in the second innings of all matches?
Evidence: got out by being stumped refers to Out_Name = 'stumped'; the second innings refers to Innings_No = 2
SQL: 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'
Database: soccer_2016
Question: How many times did Yuvraj Singh receive the Man of the Match award?
Evidence: Yuvraj Singh refers to Player_Name = 'Yuvraj Singh'; receive the Man of the Match award refers to Player_Id = Man_of_the_Match
SQL: 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
Database: soccer_2016
Question: Among the players who were born in 1977, provide names and birthdates of the players from England.
Evidence: born in 1977 refers to DOB LIKE '1977%'; name refers to Player_Name; birthdate refers to DOB; England refers to Country_Name = 'England'
SQL: SELECT T2.Player_Name, T2.DOB FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.DOB LIKE '1977%' AND T1.Country_Name = 'England'
Database: soccer_2016
Question: Who got the Man of the Series Award in 2010?
Evidence: 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
SQL: 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
Database: soccer_2016
Question: Calculate the win rate of the team "Chennai Super Kings".
Evidence: 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%
SQL: 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'
Database: soccer_2016
Question: List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016.
Evidence: 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'
SQL: 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'
Database: soccer_2016
Question: Provide the names and birthdates of players who have left-arm fast skills.
Evidence: player's name refers to Player_Name; birthdate refers to DOB; have left-arm fast skills refers to Bowling_skill = 'Left-arm fast'
SQL: 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'
Database: soccer_2016
Question: Where did BR Doctrove come from?
Evidence: the country the umpire comes from refers to Country_Name; BR Doctrove refers to Umpire_Name = 'BR Doctrove'
SQL: 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'
Database: soccer_2016
Question: Who was the captain of the winning team in the match held on 1st June 2008?
Evidence: 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'
SQL: 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
Database: soccer_2016
Question: Which team did CK Kapugedera belong to? How many matches did he play?
Evidence: team refers to Team_Name; CK Kapugedera refers to Player_Name = 'CK Kapugedera'
SQL: SELECT T3.Team_Name, COUNT(T2.Match_Id) 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 T1.Player_Name = 'CK Kapugedera'
Database: soccer_2016
Question: Among the matches held in Mumbai, how many percent of them were held in Wankhede Stadium?
Evidence: 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'
SQL: 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'
Database: soccer_2016
Question: Among the players out in match ID 392187, calculate the percentage of players out by bowl.
Evidence: 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
SQL: 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
Database: soccer_2016
Question: How many percent of the toss-winners decided to bowl first on the pitch from 2010 to 2016?
Evidence: 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'
SQL: 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'
Database: soccer_2016
Question: List down the ID of toss winners who decided to bat after winning the "toss of the coin".
Evidence: decided to bat refers to Toss_Decide = 2; ID of toss winners refers to Toss_winner
SQL: SELECT Toss_Winner FROM Match WHERE Toss_Decide = 2
Database: soccer_2016
Question: List down the match ID of matches that the "man of the match" award was given to BB McCullum.
SQL: 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'
Database: soccer_2016
Question: List down the DOB of players who received the "man of the match" award.
SQL: SELECT T2.DOB FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match
Database: soccer_2016
Question: List down the name of teams that won the toss of the coin from matches with ID from 336010 to 336020.
Evidence: 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
SQL: 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
Database: soccer_2016
Question: How many matches have Mumbai Indians won?
Evidence: Mumbai Indians refers to Team_Name = 'Mumbai Indians'; won refers to Match_Winner
SQL: 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
Database: soccer_2016
Question: List down names of teams that have played as second team against Pune Warriors.
Evidence: names of teams refers to Team_Name; second team refers to Team_2; Pune Warriors refers to Team_Name = 'Pune Warriors'
SQL: 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
Database: soccer_2016
Question: What is the name of the team that won match ID 336000?
Evidence: name of the team refers to Team_Name; won refers to Match_Winner
SQL: 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
Database: soccer_2016
Question: What are the match IDs that were played at Brabourne Stadium?
Evidence: at Brabourne Stadium refers to Venue_Name = 'Brabourne Stadium'
SQL: 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'
Database: soccer_2016
Question: List down the name of venues in season 2.
Evidence: name of venues refers to Venue_Name; season 2 refers to Season_Id = 2
SQL: 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
Database: soccer_2016
Question: What is the city of M Chinnaswamy Stadium?
Evidence: city refers to City_Name; M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'
SQL: 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'
Database: soccer_2016
Question: List down all of the venues in Mumbai.
Evidence: venues refers to Venue_Name; Mumbai refers to City_Name = 'Mumbai'
SQL: 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'
Database: soccer_2016
Question: List down all of the winning teams' IDs that played in St George's Park.
Evidence: winning teams' refers to Match_Winner; played in St George's Park refers to Venue_Name like 'St George%'
SQL: 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%'
Database: soccer_2016
Question: Is SuperSport Park located at Centurion?
Evidence: SuperSport Park refers to Venue_Name = 'SuperSport Park'; Centurion refers to City_Name = 'Centurion'
SQL: 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%'
Database: soccer_2016
Question: Calculate the total winning match for Deccan Chargers.
Evidence: winning refers to Match_Winner; Deccan Chargers refers to Team_Name = 'Deccan Chargers'
SQL: 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'
Database: soccer_2016
Question: Count the total venues located in Pune City.
Evidence: Pune City refers to City_Name = 'Pune'
SQL: SELECT SUM(T1.Venue_Name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T2.City_Name = 'Pune'
Database: soccer_2016
Question: Give the player id of the player who was at the non-striker end for the most number of balls in the match 501219.
Evidence: 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
SQL: SELECT Ball_Id FROM Ball_by_Ball WHERE Non_Striker = Ball_Id ORDER BY Ball_Id DESC LIMIT 1
Database: soccer_2016
Question: Calculate the average runs scored during the first half of all first innings.
Evidence: 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
SQL: 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