input
stringlengths
193
2.69k
output
stringlengths
24
744
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 ...
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';
[INST] Here is a database schema: Out_Type : Out_Id [ INTEGER ] primary_key Out_Name [ TEXT ] Wicket_Taken : Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = ...
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;
[INST] Here is a database schema: Toss_Decision : Toss_Id [ INTEGER ] primary_key Toss_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_I...
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';
[INST] Here is a database schema: Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id Toss_Winner [ INTEGER...
SELECT Toss_Winner FROM Match WHERE Toss_Decide = 2;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT T2.DOB FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ]...
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';
[INST] Here is a database schema: Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ]...
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;
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Please write me a SQL statement that answers the following question: What is the city of M Chi...
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';
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Please write me a SQL statement that answers the following question: List down all of the venu...
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';
[INST] Here is a database schema: Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ]...
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%';
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Please write me a SQL statement that answers the following question: Is SuperSport Park locate...
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%';
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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';
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Please write me a SQL statement that answers the following question: Count the total venues lo...
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';
[INST] Here is a database schema: Ball_by_Ball : Match_Id [ INTEGER ] Ball_by_Ball.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Innings_No [ INTEGER ] Team_Batting [ INTEGER ] Team_Bowling [ INTEGER ] Striker_Batting_Position [ INTEGER ] Striker [ INTEGER ] Non_Striker [ INTEGER ] Bowler [ INTEGER ...
SELECT Ball_Id FROM Ball_by_Ball WHERE Non_Striker = Ball_Id ORDER BY Ball_Id DESC LIMIT 1;
[INST] Here is a database schema: Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Runs_Scored [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL statement that answers the following question: Calculate the average runs scored during the first...
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;
[INST] Here is a database schema: Extra_Runs : Match_Id [ INTEGER ] Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id Extra_Runs [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL statement that answers the following question: What are the average ex...
SELECT AVG(Innings_No) FROM Extra_Runs WHERE Innings_No = 2;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT Player_Name FROM Player WHERE DOB BETWEEN '1970-01-01' AND '1990-12-31' ORDER BY DOB DESC;
[INST] Here is a database schema: Wicket_Taken : Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = Out_Type.Out_Id Fielders [ INTEGER ] Wicket_Taken.Fielders =...
SELECT SUM(CASE WHEN Fielders = '' THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Over_Id = 3;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Umpire : Umpire_Id [ INTEGER ] primary_key Umpire_Name [ TEXT ] Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id Please write me a SQL statement that answers the following question: From which coun...
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;
[INST] Here is a database schema: Rolee : Role_Id [ INTEGER ] primary_key Role_Desc [ TEXT ] Player_Match : Match_Id [ INTEGER ] Player_Match.Match_Id = Match.Match_Id Player_Id [ INTEGER ] Player_Match.Player_Id = Player.Player_Id Role_Id [ INTEGER ] Player_Match.Role_Id = Rolee.Role_Id Team_Id [ INTEGER ] Player_Matc...
SELECT CAST(SUM(CASE WHEN T2.Role_Desc = 'CaptainKeeper' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_Id;
[INST] Here is a database schema: Out_Type : Out_Id [ INTEGER ] primary_key Out_Name [ TEXT ] Wicket_Taken : Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = ...
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';
[INST] Here is a database schema: Batting_Style : Batting_Id [ INTEGER ] primary_key Batting_hand [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B...
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;
[INST] Here is a database schema: Bowling_Style : Bowling_Id [ INTEGER ] primary_key Bowling_skill [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style....
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Out_Type : Out_Id [ INTEGER ] primary_key Out_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_sk...
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;
[INST] Here is a database schema: Out_Type : Out_Id [ INTEGER ] primary_key Out_Name [ TEXT ] Wicket_Taken : Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = ...
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';
[INST] Here is a database schema: Ball_by_Ball : Match_Id [ INTEGER ] Ball_by_Ball.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Innings_No [ INTEGER ] Team_Batting [ INTEGER ] Team_Bowling [ INTEGER ] Striker_Batting_Position [ INTEGER ] Striker [ INTEGER ] Non_Striker [ INTEGER ] Bowler [ INTEGER ...
SELECT DISTINCT Over_Id FROM Ball_by_Ball WHERE Striker = 7;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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_Ca...
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling...
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';
[INST] Here is a database schema: Batting_Style : Batting_Id [ INTEGER ] primary_key Batting_hand [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B...
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Umpire : Umpire_Id [ INTEGER ] primary_key Umpire_Name [ TEXT ] Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id Please write me a SQL statement that answers the following question: List the name o...
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';
[INST] Here is a database schema: Bowling_Style : Bowling_Id [ INTEGER ] primary_key Bowling_skill [ TEXT ] Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting...
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';
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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';
[INST] Here is a database schema: Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ]...
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';
[INST] Here is a database schema: Extra_Type : Extra_Id [ INTEGER ] primary_key Extra_Name [ TEXT ] Extra_Runs : Match_Id [ INTEGER ] Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id Extra_Runs [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL stat...
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';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT Player_Id FROM Player ORDER BY Bowling_skill DESC LIMIT 5;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT COUNT(*) FROM Player WHERE DOB < '1975-10-16' AND Bowling_skill < 3;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1;
[INST] Here is a database schema: Season : Season_Id [ INTEGER ] primary_key Man_of_the_Series [ INTEGER ] Orange_Cap [ INTEGER ] Purple_Cap [ INTEGER ] Season_Year [ INTEGER ] Please write me a SQL statement that answers the following question: Tally the player IDs of "Man of the Series" awardees for the seasons from...
SELECT Man_of_the_Series FROM Season WHERE 2011 < Season_Year < 2015;
[INST] Here is a database schema: Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Runs_Scored [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL statement that answers the following question: What is the total number of runs scored by the bat...
SELECT SUM(Runs_Scored) FROM Batsman_Scored WHERE Match_Id = 335988 AND Innings_No = 2;
[INST] Here is a database schema: Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Runs_Scored [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL statement that answers the following question: Between match nos. 335989 and 337000, how many tim...
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling...
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';
[INST] Here is a database schema: Bowling_Style : Bowling_Id [ INTEGER ] primary_key Bowling_skill [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style....
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';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Umpire : Umpire_Id [ INTEGER ] primary_key Umpire_Name [ TEXT ] Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id Please write me a SQL statement that answers the following question: Write down the ...
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';
[INST] Here is a database schema: Toss_Decision : Toss_Id [ INTEGER ] primary_key Toss_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_I...
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 AN...
[INST] Here is a database schema: Toss_Decision : Toss_Id [ INTEGER ] primary_key Toss_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_I...
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 AN...
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT DOB FROM Player GROUP BY DOB ORDER BY COUNT(DOB) DESC LIMIT 1;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Please write me a SQL statement that answers the following question: How many cities are in U.A.E? [/INST]
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Umpire : Umpire_Id [ INTEGER ] primary_key Umpire_Name [ TEXT ] Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id Please write me a SQL statement that answers the following question: List the names ...
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';
[INST] Here is a database schema: Bowling_Style : Bowling_Id [ INTEGER ] primary_key Bowling_skill [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style....
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';
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Umpire : Umpire_Id [ INTEGER ] primary_key Umpire_Name [ TEXT ] Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id Please write me a SQL statement that answers the following question: Which country i...
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';
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Please write me a SQL statement that answers the following question: What are the names of the...
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';
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ]...
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;
[INST] Here is a database schema: Ball_by_Ball : Match_Id [ INTEGER ] Ball_by_Ball.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Innings_No [ INTEGER ] Team_Batting [ INTEGER ] Team_Bowling [ INTEGER ] Striker_Batting_Position [ INTEGER ] Striker [ INTEGER ] Non_Striker [ INTEGER ] Bowler [ INTEGER ...
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;
[INST] Here is a database schema: Batsman_Scored : Match_Id [ INTEGER ] Batsman_Scored.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Runs_Scored [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL statement that answers the following question: List the ball IDs, scores, and innings numbers in ...
SELECT Ball_Id, Runs_Scored, Innings_No FROM Batsman_Scored WHERE Match_Id = 335988 AND Over_Id = 20;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT 2022 - SUBSTR(DOB, 1, 4) FROM Player WHERE Player_Name = 'Ishan Kishan';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling...
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%';
[INST] Here is a database schema: Batting_Style : Batting_Id [ INTEGER ] primary_key Batting_hand [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.B...
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;
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling...
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;
[INST] Here is a database schema: Bowling_Style : Bowling_Id [ INTEGER ] primary_key Bowling_skill [ TEXT ] Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting...
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';
[INST] Here is a database schema: Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Umpire : Umpire_Id [ INTEGER ] primary_key Umpire_Name [ TEXT ] Umpire_Country [ INTEGER ] Umpire.Umpire_Country = Country.Country_Id Please write me a SQL statement that answers the following question: List the IDs an...
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';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Extra_Type : Extra_Id [ INTEGER ] primary_key Extra_Name [ TEXT ] Extra_Runs : Match_Id [ INTEGER ] Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Extra_Type_Id [ INTEGER ] Extra_Runs.Extra_Type_Id = Extra_Type.Extra_Id Extra_Runs [ INTEGER ] Innings_No [ INTEGER ] Please write me a SQL stat...
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';
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Win_By : Win_Id [ INTEGER ] primary_key Win_Type [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INT...
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;
[INST] Here is a database schema: Out_Type : Out_Id [ INTEGER ] primary_key Out_Name [ TEXT ] Wicket_Taken : Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = ...
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;
[INST] Here is a database schema: Wicket_Taken : Match_Id [ INTEGER ] Wicket_Taken.Match_Id = Match.Match_Id Over_Id [ INTEGER ] Ball_Id [ INTEGER ] Player_Out [ INTEGER ] Wicket_Taken.Player_Out = Player.Player_Id Kind_Out [ INTEGER ] Wicket_Taken.Kind_Out = Out_Type.Out_Id Fielders [ INTEGER ] Wicket_Taken.Fielders =...
SELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2;
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Please write me a SQL statement that answers the following question: Which is the country of the city named "Rajkot"? [/INST]
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot';
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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';
[INST] Here is a database schema: City : City_Id [ INTEGER ] primary_key City_Name [ TEXT ] Country_id [ INTEGER ] Country : Country_Id [ INTEGER ] primary_key Country_Name [ TEXT ] Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Please write me a SQL state...
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';
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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;
[INST] Here is a database schema: Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ]...
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';
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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 );
[INST] Here is a database schema: Venue : Venue_Id [ INTEGER ] primary_key Venue_Name [ TEXT ] City_Id [ INTEGER ] Venue.City_Id = City.City_Id Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ]...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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;
[INST] Here is a database schema: Team : Team_Id [ INTEGER ] primary_key Team_Name [ TEXT ] Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEG...
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%';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
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';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT COUNT(Player_Name) FROM Player WHERE Bowling_skill > 2;
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT COUNT(Player_Name) FROM Player WHERE DOB LIKE '1970%';
[INST] Here is a database schema: Player : Player_Id [ INTEGER ] primary_key Player_Name [ TEXT ] DOB [ DATE ] Batting_hand [ INTEGER ] Player.Batting_hand = Batting_Style.Batting_Id Bowling_skill [ INTEGER ] Player.Bowling_skill = Bowling_Style.Bowling_Id Country_Name [ INTEGER ] Player.Country_Name = Country.Country_...
SELECT COUNT(Player_Name) FROM Player WHERE DOB LIKE '198%' AND Bowling_skill = 2;
[INST] Here is a database schema: Match : Match_Id [ INTEGER ] primary_key Team_1 [ INTEGER ] Match.Team_1 = Team.Team_Id Team_2 [ INTEGER ] Match.Team_2 = Team.Team_Id Match_Date [ DATE ] Season_Id [ INTEGER ] Match.Season_Id = Season.Season_Id Venue_Id [ INTEGER ] Match.Venue_Id = Venue.Venue_Id Toss_Winner [ INTEGER...
SELECT COUNT(Match_Id) FROM Match WHERE Match_date LIKE '2008-04%';