problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Which team has the highest number of losses of all time?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Who is the player who won the first ever "man of the match" award?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Player_Name FROM Player WHERE Player_Id = ( SELECT Man_of_the_Match FROM `Match` ORDER BY match_date ASC LIMIT 1 )
Write SQL query to solve given problem: When did Chennai Super Kings play its first match?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many players with left-hand batting style are from India?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Who is the player that has the highest number of roles as a captain for Deccan Chargers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the percentage of all right-handed batting players among all the other players?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Name the player who is born on July 7, 1981.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Player_name FROM Player WHERE DOB = '1981-07-07'
Write SQL query to solve given problem: How many matches were played by the player with player ID 2?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match
Write SQL query to solve given problem: List the first team's name in the match with the highest winning margin.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Give the country where St. George's Park is located.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: List the player's name of Mumbai Indians in the match ID 335990.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Provide the winning team's name in the match with the point of winning margin of 7 on May 7, 2009.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many of the matches are Superover?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the total number of won matches of the team named "Pune Warriors"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Among the matches held in 2015, who is the winning team in the match ID 829768?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the role of K Goel in the match ID 335992?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: How many cities are located in South Africa?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many matches were held at the venue named "Newlands"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Provide the point of the winning margin in a match between Mumbai Indians and Royal Challengers Bangalore on May 28, 2008.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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')
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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%'
Write SQL query to solve given problem: Among the players born in 1977, what is the percentage of the players with a role as a captain?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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%'
Write SQL query to solve given problem: How many overs were there in the first innings of match ID "335996"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1
Write SQL query to solve given problem: List the over IDs, ball IDs, and innings numbers of the match ID "336004" while the batsman got the maximum scores.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Over_Id, Ball_Id, Innings_No FROM Batsman_Scored WHERE Match_Id = 336004 ORDER BY Runs_Scored DESC LIMIT 1
Write SQL query to solve given problem: Describe any five matches IDs that reached over ID 20.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Match_Id FROM Ball_by_Ball WHERE Over_Id = 20 GROUP BY Match_Id LIMIT 5
Write SQL query to solve given problem: How many players got out in the first inning of match ID "548335"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN Match_Id = 548335 THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Innings_No = 1
Write SQL query to solve given problem: List the players' names who were born in 1971.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Player_name FROM Player WHERE DOB LIKE '1971%'
Write SQL query to solve given problem: Provide the match IDs which were held on 18th April 2015.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Match_Id FROM Match WHERE Match_Date LIKE '%2015-04-18%'
Write SQL query to solve given problem: List the match IDs which had players out by hit wickets.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: How many players got out by being stumped in the second innings of all matches?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: How many times did Yuvraj Singh receive the Man of the Match award?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Among the players who were born in 1977, provide names and birthdates of the players from England.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Who got the Man of the Series Award in 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Calculate the win rate of the team "Chennai Super Kings".. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Provide the names and birthdates of players who have left-arm fast skills.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Who was the captain of the winning team in the match held on 1st June 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Among the matches held in Mumbai, how many percent of them were held in Wankhede Stadium?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Among the players out in match ID 392187, calculate the percentage of players out by bowl.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many percent of the toss-winners decided to bowl first on the pitch from 2010 to 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: List down the ID of toss winners who decided to bat after winning the "toss of the coin".. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Toss_Winner FROM Match WHERE Toss_Decide = 2
Write SQL query to solve given problem: List down the name of teams that won the toss of the coin from matches with ID from 336010 to 336020.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many matches have Mumbai Indians won?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the name of the team that won match ID 336000?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: List down the name of venues in season 2.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Give the player id of the player who was at the non-striker end for the most number of balls in the match 501219.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Ball_Id FROM Ball_by_Ball WHERE Non_Striker = Ball_Id ORDER BY Ball_Id DESC LIMIT 1
Write SQL query to solve given problem: Calculate the average runs scored during the first half of all first innings.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What are the average extra runs given in the second innings of every match?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT AVG(Innings_No) FROM Extra_Runs WHERE Innings_No = 2
Write SQL query to solve given problem: Among the matches, what percentage have a winning margin above 100?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(COUNT(CASE WHEN Win_Margin > 100 THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(Match_Id) FROM `Match`
Write SQL query to solve given problem: List the name of the players born between 1970 and 1990 in descending order of age.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Player_Name FROM Player WHERE DOB BETWEEN '1970-01-01' AND '1990-12-31' ORDER BY DOB DESC
Write SQL query to solve given problem: Of the wickets taken in the third overs, how many are without the involvement of fielders?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN Fielders = '' THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Over_Id = 3
Write SQL query to solve given problem: From which country does the most umpires are from? How many of them are from the mentioned country? . Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Among the players, what percentage are both captain and keeper?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: In the players, how many were out by hit wicket?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: On average, how many players from each country bat with their right hand?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What percentage of players have Legbreak skill?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: In the matches where the winning margin is less than fifty, how many teams won by wicket?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(T2.Win_Id) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50
Write SQL query to solve given problem: In how many venues did team 2 win the toss and lose the match?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN T1.Team_2 = T1.Match_Winner THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Team_1 = T1.Toss_Winner
Write SQL query to solve given problem: Which player became the man of the series in the year 2012? Give the name and country of this player.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Give the name of the venue where the most number of matches are held.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id GROUP BY T2.Venue_Name ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1
Write SQL query to solve given problem: Which city hosted the least number of no-result matches?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T4.City_Name FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Venue AS T3 ON T1.Venue_Id = T3.Venue_Id INNER JOIN City AS T4 ON T3.City_Id = T4.City_Id WHERE T2.Win_Type = 'NO Result' GROUP BY T4.City_Id ORDER BY COUNT(T2.Win_Type) ASC LIMIT 1
Write SQL query to solve given problem: Write the name of the player who was the man of the series more than one time.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Of the matches that were won by runs by team 1, what percentage have team 1 won the toss and decided to field?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(COUNT(CASE WHEN T1.Team_1 = T1.Match_Winner = T1.Toss_Winner THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Team_1) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Toss_Decision AS T3 ON T1.Toss_Decide = T3.Toss_Id WHERE T3.Toss_Name = 'field' AND T2.Win_Type = 'runs'
Write SQL query to solve given problem: What is the difference in the average number of players out by lbw and runout in the matches?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Identify by their ID all the overs in which the player with ID 7 was on strike.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT DISTINCT Over_Id FROM Ball_by_Ball WHERE Striker = 7
Write SQL query to solve given problem: How many first teams chose to bat after winning the toss?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Team_1) FROM `Match` WHERE Team_1 = Toss_Winner AND Toss_Decide = 2
Write SQL query to solve given problem: How many games were played in March 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN Match_Date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `Match`
Write SQL query to solve given problem: How many players are older than Gurkeerat Singh player?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh'
Write SQL query to solve given problem: How many times has SR Watson been named 'Man of the Match'?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN T2.Player_Name = 'SR Watson' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id
Write SQL query to solve given problem: Indicate the name of the most versatile players of the Delhi Daredevils.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the name of the player who has been chosen the most times for 'Man of the Series'?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many players bat with their left hands?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many games were not won by runs?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN T2.Win_Type != 'runs' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
Write SQL query to solve given problem: In which country do most players have the 'slow left-arm chinaman' bowling style?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: In how many games in which the batting team was the Delhi Daredevils were no runs scored?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: In what percentage of games played at the Dr DY Patil Sports Academy venue did the winning team win by a margin of less than 10?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: What is the average number of extra runs made as noballs?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: List the player's ID of the top five players, by descending order, in terms of bowling skill.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Player_Id FROM Player ORDER BY Bowling_skill DESC LIMIT 5
Write SQL query to solve given problem: How many players were born before 10/16/1975, and have a bowling skill of less than 3?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(*) FROM Player WHERE DOB < '1975-10-16' AND Bowling_skill < 3
Write SQL query to solve given problem: What is the name of the youngest player?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1
Write SQL query to solve given problem: Tally the player IDs of "Man of the Series" awardees for the seasons from 2011 to 2015.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Man_of_the_Series FROM Season WHERE 2011 < Season_Year < 2015
Write SQL query to solve given problem: What is the total number of runs scored by the batsmen during the 2nd inning of the match ID 335988?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(Runs_Scored) FROM Batsman_Scored WHERE Match_Id = 335988 AND Innings_No = 2
Write SQL query to solve given problem: Between match nos. 335989 and 337000, how many times did a batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many times did the matches were held in MA Chidambaram Stadium from 5/9/2009 to 8/8/2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN Venue_Name = 'MA Chidambaram Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE Match_Date BETWEEN '2009-05-09' AND '2011-08-08'
Write SQL query to solve given problem: Where was the ID 336005 match held? Please give me the venue and the city.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T2.Venue_Name, T3.City_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN City AS T3 ON T2.City_Id = T3.City_Id WHERE T1.Match_Id = '336005'
Write SQL query to solve given problem: Which team wins the toss during the match ID 336011, and can you tell me whether they decided to bat or field?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T2.Toss_Name, T1.Toss_Decide, T1.Toss_Winner FROM `Match` AS T1 INNER JOIN Toss_Decision AS T2 ON T1.Toss_Decide = T2.Toss_Id WHERE T1.Match_Id = '336011'
Write SQL query to solve given problem: Among the South African players, how many were born before 4/11/1980?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: When and for what role did the youngest player appear in his first match?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T1.Match_Date, T4.Role_Desc FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id ORDER BY T3.DOB DESC LIMIT 1
Write SQL query to solve given problem: From 2011 to 2012, how many Australian players became the "Man of the Match"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN T1.Match_Date BETWEEN '2011%' AND '2012%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_Name WHERE T3.Country_Name = 'Australia'
Write SQL query to solve given problem: Calculate the run rate at the end of 17 overs of the match ID 335987 on 4/18/2008.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 17
Write SQL query to solve given problem: Compute the run rate at the end of 16 overs of the match ID 335999. Please include the name of the "Man of_the Match".. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 16
Write SQL query to solve given problem: What is the id of the team with the highest number of matches won?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Match_Id FROM `Match` ORDER BY Match_Winner DESC LIMIT 1
Write SQL query to solve given problem: Which year do the majority of the players were born?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT DOB FROM Player GROUP BY DOB ORDER BY COUNT(DOB) DESC LIMIT 1
Write SQL query to solve given problem: What is the date of the match that has the highest wager on the final result of a game?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Match_Date FROM `Match` ORDER BY Win_Margin DESC LIMIT 1
Write SQL query to solve given problem: Which season has the fewest number of matches?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Season_Id FROM `Match` GROUP BY Season_Id ORDER BY COUNT(Match_Id) LIMIT 1
Write SQL query to solve given problem: How many players have won at least 5 man of the match awards?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM `Match` GROUP BY Man_of_the_Match HAVING COUNT(Match_Id) >= 5
Write SQL query to solve given problem: Who is the player who received the man of the match award during the last match of Season 9?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the name of the team that won the first ever match?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many cities are in U.A.E?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: List the names of all the umpires from England.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: How many matches did Rajasthan Royals play in Season 8?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN T1.Season_Id = 8 THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Rajasthan Royals'