1sf/bird-sql-train-with-schema huggingface dataset:
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: Calculate the average players out in the first innings per match. How many of them were out by the leg before wicket?
Evidence: out by the leg refers to Out_Name = 'lbw'; out in the first innings refers to Innings_No = 2;
SQL: 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
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: How many matches are there in 2008?
Evidence: in 2008 refers to Match_Date like '2008%'
SQL: SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2008%'
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: Count the matches with a total of two innings.
Evidence: total of two innings refers to innings_no = 2;
SQL: SELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: Which is the country of the city named "Rajkot"?
Evidence: city named "Rajkot" refers to city_name = 'Rajkot';
SQL: SELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot'
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: How many of the matches are Superover?
Evidence: are Superover refers to win_type = 'wickets';
SQL: 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
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: What are the teams that played in a match with the point of winning margin of 38 on April 30, 2009?
Evidence: 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;
SQL: 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'
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: Give the name of the team of T Kohli in the match ID 335989.
Evidence: team of T Kohli refers to player_name = 'T Kohli';
SQL: 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'
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: How many venues are located at Centurion, South Africa?
Evidence: venues are located at Centurion refers to city_name = 'Centurion'; South Africa refers to country_name = 'South Africa'
SQL: 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'
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: Among the matches of Delhi Daredevils in 2014, how many won matches are there?
Evidence: Delhi Daredevils refers to team_name = 'Delhi Daredevils'; in 2014 refers to Match_Date contains '2014';
SQL: 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%'
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: Among the matches played by Royal Challengers Bangalore, what is the match ID of the match with the highest winning margin?
Evidence: Royal Challengers Bangalore refers to team_name = 'Royal Challengers Bangalore'; highest winning margin refers to MAX(win_margin)
SQL: 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
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: How many times did K Goel played as a player only?
Evidence: K Goel refers to Player_Name = 'K Goel'; played as a player only refers to Role_Id = 3
SQL: 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
Database: soccer_2016
Tables: Batting_Style, Bowling_Style, City, Country, Extra_Type, Extra_Runs, Out_Type, Outcome, Player, Rolee, Season, Team, Toss_Decision, Umpire, Venue, Win_By, Match, Ball_by_Ball, Batsman_Scored, Player_Match, Wicket_Taken
Columns (table index, column name): -1, *, 0, Batting_Id, 0, Batting_hand, 1, Bowling_Id, 1, Bowling_skill, 2, City_Id, 2, City_Name, 2, Country_id, 3, Country_Id, 3, Country_Name, 4, Extra_Id, 4, Extra_Name, 5, Match_Id, 5, Over_Id, 5, Ball_Id, 5, Extra_Type_Id, 5, Extra_Runs, 5, Innings_No, 6, Out_Id, 6, Out_Name, 7, Outcome_Id, 7, Outcome_Type, 8, Player_Id, 8, Player_Name, 8, DOB, 8, Batting_hand, 8, Bowling_skill, 8, Country_Name, 9, Role_Id, 9, Role_Desc, 10, Season_Id, 10, Man_of_the_Series, 10, Orange_Cap, 10, Purple_Cap, 10, Season_Year, 11, Team_Id, 11, Team_Name, 12, Toss_Id, 12, Toss_Name, 13, Umpire_Id, 13, Umpire_Name, 13, Umpire_Country, 14, Venue_Id, 14, Venue_Name, 14, City_Id, 15, Win_Id, 15, Win_Type, 16, Match_Id, 16, Team_1, 16, Team_2, 16, Match_Date, 16, Season_Id, 16, Venue_Id, 16, Toss_Winner, 16, Toss_Decide, 16, Win_Type, 16, Win_Margin, 16, Outcome_type, 16, Match_Winner, 16, Man_of_the_Match, 17, Match_Id, 17, Over_Id, 17, Ball_Id, 17, Innings_No, 17, Team_Batting, 17, Team_Bowling, 17, Striker_Batting_Position, 17, Striker, 17, Non_Striker, 17, Bowler, 18, Match_Id, 18, Over_Id, 18, Ball_Id, 18, Runs_Scored, 18, Innings_No, 19, Match_Id, 19, Player_Id, 19, Role_Id, 19, Team_Id, 20, Match_Id, 20, Over_Id, 20, Ball_Id, 20, Player_Out, 20, Kind_Out, 20, Fielders, 20, Innings_No
Question: What is the average winning margin of the matches held in Newlands?
Evidence: average winning margin refers to avg(win_margin); held in Newlands refers to venue_name = 'Newlands'
SQL: 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'