problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Which country is umpire TH Wijewardene from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Which country is the youngest player from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: List all the names of the winning team's players in the first match of season 1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T3.Player_Name FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Winner = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T1.Season_Id = 1 ORDER BY T1.Match_Date LIMIT 1
Write SQL query to solve given problem: Who is the youngest player to have won the Purple Cap?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Provide the complete name of the venue, city and country where the last match was held.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many overs were there in each innings of match ID "336011"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: List the ball IDs, scores, and innings numbers in the over ID 20 of match ID "335988".. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT Ball_Id, Runs_Scored, Innings_No FROM Batsman_Scored WHERE Match_Id = 335988 AND Over_Id = 20
Write SQL query to solve given problem: How many matches were held in 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2011%'
Write SQL query to solve given problem: How old is Ishan Kishan in 2022?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT 2022 - SUBSTR(DOB, 1, 4) FROM Player WHERE Player_Name = 'Ishan Kishan'
Write SQL query to solve given problem: Calculate the win rate of the toss-winners in 2012.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(SUM(CASE WHEN Toss_Winner = Match_Winner THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN Match_Date LIKE '2012%' THEN 1 ELSE 0 END) FROM `Match`
Write SQL query to solve given problem: How many matches in 2009 had win margins of less than 10?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2009%' AND Win_Margin < 10
Write SQL query to solve given problem: Provide the players' names in both teams of the match that was held in June 2014.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many matches did Mohammad Hafeez play?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Among the players from South Africa, provide the players' names who were born in 1984.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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%'
Write SQL query to solve given problem: Among the" Mumbai Indians" team that played in 2009, how many percent of the matches did they win?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(SUM(CASE WHEN T1.Match_Winner = T2.Team_Id THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Mumbai Indians' AND T1.Match_Date LIKE '2009%'
Write SQL query to solve given problem: What is the ratio of players with batting hands of left and right?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: Who is the eldest player and where did he/she come from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many matches did the Sunrisers Hyderabad team win in 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT SUM(CASE WHEN Match_Date LIKE '2013%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'
Write SQL query to solve given problem: Provide match ID which had the extra type of penalty.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Name the teams played in a match which resulted in a tie in 2015.. 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.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
Write SQL query to solve given problem: Calculate the average players out in the first innings per match. How many of them were out by the leg before wicket?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many matches are there in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2008%'
Write SQL query to solve given problem: Count the matches with a total of two innings.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2
Write SQL query to solve given problem: Which is the country of the city named "Rajkot"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot'
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.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
Write SQL query to solve given problem: What are the teams that played in a match with the point of winning margin of 38 on April 30, 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.Team_1 WHERE T2.win_margin = 38 AND match_date = '2009-04-30'
Write SQL query to solve given problem: Give the name of the team of T Kohli in the match ID 335989.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: How many venues are located at Centurion, South Africa?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Among the matches of Delhi Daredevils in 2014, how many won matches are there?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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%'
Write SQL query to solve given problem: Among the matches played by Royal Challengers Bangalore, what is the match ID of the match with the highest winning margin?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: How many times did K Goel played as a player only?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the average winning margin of the matches held in Newlands?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: Provide the losing team's name in the match ID 336039.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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 )
Write SQL query to solve given problem: What is the venue for the match ID 829768?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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
Write SQL query to solve given problem: What is the second team's name in the match with the lowest winning margin?. 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.team_2 ORDER BY T2.win_margin LIMIT 1
Write SQL query to solve given problem: Among the matches in 2013, what is the percentage of winning of the team "Mumbai Indians"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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%'
Write SQL query to solve given problem: What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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'
Write SQL query to solve given problem: How many players have the bowling skill greater than 2?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Player_Name) FROM Player WHERE Bowling_skill > 2
Write SQL query to solve given problem: How many players were born in 1970?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Player_Name) FROM Player WHERE DOB LIKE '1970%'
Write SQL query to solve given problem: How many players were born in the 80s and have bowling skill of 2?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Player_Name) FROM Player WHERE DOB LIKE '198%' AND Bowling_skill = 2
Write SQL query to solve given problem: How many matches are there in April, 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM Match WHERE Match_date LIKE '2008-04%'
Write SQL query to solve given problem: What is the city name of country ID 3?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT City_Name FROM City WHERE Country_ID = 3
Write SQL query to solve given problem: How many victory matches were there in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM Match WHERE Match_Date LIKE '2008%' AND Match_Winner IS NOT NULL
Write SQL query to solve given problem: How old is SC Ganguly in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT 2008 - strftime('%Y', DOB) FROM Player WHERE Player_Name = 'SC Ganguly'
Write SQL query to solve given problem: List the names of players who play by the left hand.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_hand = 'Left-hand bat'
Write SQL query to solve given problem: What are the names of players who participated in season year 2008?. 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 INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008 GROUP BY T1.Player_Name
Write SQL query to solve given problem: What are the names of players that have run scored less than 3?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Batsman_Scored AS T3 ON T2.Match_ID = T3.Match_ID WHERE T3.Runs_Scored < 3 GROUP BY T1.Player_Name
Write SQL query to solve given problem: What are the names of players in team 1?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
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 WHERE T3.Team_Id = 1 GROUP BY T1.Player_Name
Write SQL query to solve given problem: How many players played as a captain in season year 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(T1.Player_Id) FROM Player_Match AS T1 INNER JOIN Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T3.Role_Desc = 'Captain' AND T2.Match_Date LIKE '2008%'
Write SQL query to solve given problem: Which teams did SC Ganguly join in season year 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T5.Team_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id WHERE T4.Season_Year = 2008 AND T1.Player_Name = 'SC Ganguly' GROUP BY T5.Team_Name
Write SQL query to solve given problem: What type did match ID 336000 win?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T2.Win_Type FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T1.Match_Id = 336000
Write SQL query to solve given problem: How many players have left arm fast in bowling skill?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_skill = 'Left-arm fast'
Write SQL query to solve given problem: What is the outcome type of match ID 392195?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T2.Outcome_Type FROM Match AS T1 INNER JOIN Outcome AS T2 ON T1.Outcome_type = T2.Outcome_Id WHERE T1.Match_Id = '392195'
Write SQL query to solve given problem: Who is the youngest player and which city did he/she come from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T3.City_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id INNER JOIN City AS T3 ON T2.Country_Id = T3.Country_Id ORDER BY T1.DOB LIMIT 1
Write SQL query to solve given problem: How many matches did team Kings XI Punjab win in season year 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(DISTINCT T2.Match_Id) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Kings XI Punjab' AND T4.Season_Year = 2008
Write SQL query to solve given problem: How many seasons did Pune Warriors participate in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(T.Season_Year) FROM ( SELECT T4.Season_Year FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Pune Warriors' GROUP BY T4.Season_Year ) T
Write SQL query to solve given problem: How many matches did team Mumbai Indians win in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(T.Match_Id) FROM ( SELECT T2.Match_Id FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id WHERE T1.Team_Name = 'Mumbai Indians' AND T2.Match_Date LIKE '2008%' GROUP BY T2.Match_Id ) T
Write SQL query to solve given problem: Which team won by wickets in match ID 335993?. 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 INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Win_By AS T4 ON T2.Win_Type = T4.Win_Id WHERE T2.Match_Id = '335993' GROUP BY T1.Team_Name
Write SQL query to solve given problem: Count the matches that were won by wickets in all season.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_type = 'wickets'
Write SQL query to solve given problem: What is the role of W Jaffer in season year 2012?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T4.Role_Desc 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 Rolee AS T4 ON T2.Role_Id = T4.Role_Id INNER JOIN Season AS T5 ON T3.Season_Id = T5.Season_Id WHERE T1.Player_name = 'W Jaffer' AND T5.Season_Year = 2012
Write SQL query to solve given problem: What are the names of players who had been man of the match more than 5 times in season year 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CASE WHEN COUNT(T2.Man_of_the_Match) > 5 THEN T1.Player_Name ELSE 0 END FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008
Write SQL query to solve given problem: What is the average of Indian players that were born between 1975 and 1985 among all players?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE strftime('%Y', T1.DOB) BETWEEN '1975' AND '1985'
Write SQL query to solve given problem: Calculate the percentage of left hand batting style players among all players.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id
Write SQL query to solve given problem: What is the percentage of matches that are won by runs?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(SUM(CASE WHEN T1.win_type = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Win_Type) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id
Write SQL query to solve given problem: How many matches have 7 points of winning margin?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Match_Id) FROM Match WHERE win_margin = 7
Write SQL query to solve given problem: What is the total number of players born between 1970 to 1975?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT COUNT(Player_Id) FROM Player WHERE strftime('%Y', DOB) BETWEEN '1970' AND '1975'
Write SQL query to solve given problem: Who is the winning team in a match held on April 26, 2009 with a winning margin of 6 points?. 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.Win_Margin = 6 AND T2.Match_Date = '2009-04-26'
Write SQL query to solve given problem: In the match ID 419135, who won by runs?. 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 INNER JOIN Win_By AS T3 ON T2.win_type = T3.win_id WHERE T2.Match_Id = 419135
Write SQL query to solve given problem: Among the matches held in St. George's Park, give the match ID of the match with the highest winning margin points.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T2.Match_Id FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T1.Venue_Name = 'St George''s Park' ORDER BY T2.Win_Margin DESC LIMIT 1
Write SQL query to solve given problem: Give the match's venue and winning team for the match ID 392194.. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT T1.Venue_Name, T3.Team_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id INNER JOIN Team AS T3 ON T2.match_winner = T3.Team_Id WHERE T2.Match_Id = 392194
Write SQL query to solve given problem: Among the matches of Delhi Daredevils in 2009, what is the percentage of their matches won by wickets?. Keep the solution inside sql tag ```sql [SQL-Query] ```
soccer_2016
SELECT CAST(SUM(CASE WHEN T3.Win_Type = 'wickets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Win_Type) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE T1.Team_Name = 'Delhi Daredevils'
Write SQL query to solve given problem: What is the release title of the single that was released by Ron Hunt in 1979 that was downloaded 239 times?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT groupName FROM torrents WHERE artist LIKE 'ron hunt & ronnie g & the sm crew' AND groupYear = 1979 AND releaseType LIKE 'single' AND totalSnatched = 239
Write SQL query to solve given problem: How many times was the album released by blowfly in 1980 downloaded?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT totalSnatched FROM torrents WHERE artist LIKE 'blowfly' AND groupYear = 1980
Write SQL query to solve given problem: What is the tag of the album with the highest amount of downloads?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 1
Write SQL query to solve given problem: What are the top 5 tags with the highest amount of downloads?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 5
Write SQL query to solve given problem: What is the release title of the single under the "funk" tag that was released the oldest?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'funk' AND T1.releaseType = 'single' ORDER BY T1.groupYear LIMIT 1
Write SQL query to solve given problem: Name all the release titles of the "ep's" under the alternative tag.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'alternative' AND T1.releaseType = 'ep'
Write SQL query to solve given problem: What are the tags of the top 5 least downloaded live albums?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched LIMIT 5
Write SQL query to solve given problem: What is the tag and the artist of the most downloaded single?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T2.tag, T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' ORDER BY T1.totalSnatched DESC LIMIT 1
Write SQL query to solve given problem: How many releases are tagged "1980s"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT COUNT(id) FROM tags WHERE tag LIKE '1980s'
Write SQL query to solve given problem: How many times has the release "city funk" been downloaded?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT totalSnatched FROM torrents WHERE groupName LIKE 'city funk'
Write SQL query to solve given problem: Please list the releases that have been downloaded for more than 20000 times.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT groupName FROM torrents WHERE totalSnatched > 20000
Write SQL query to solve given problem: What are the tags of the release "sugarhill gang"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'sugarhill gang'
Write SQL query to solve given problem: How many tags does the release "city funk" have?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'city funk'
Write SQL query to solve given problem: Please list the titles of all the releases with the tag "1980s".. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'
Write SQL query to solve given problem: Among the releases with the tag "1980s", which one of them is the most downloaded? Please give its title.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s' ORDER BY T1.totalSnatched DESC LIMIT 1
Write SQL query to solve given problem: How many releases by the artist michael jackson are tagged "pop"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.artist = 'michael jackson'
Write SQL query to solve given problem: Among the releases that were released in 2000, how many of them were released as an album and tagged "pop"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.releaseType = 'album' AND T1.groupYear = 2000
Write SQL query to solve given problem: What are the average download times for the a release tagged "1980s"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT CAST(SUM(T1.totalSnatched) AS REAL) / COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'
Write SQL query to solve given problem: Name the title of the top three releases with the highest number of downloads.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT groupName FROM torrents ORDER BY totalSnatched DESC LIMIT 3
Write SQL query to solve given problem: Provide the name of the artist who released his or her Single-Table in 2012 with the highest number of downloads. Name the Single-Table title as well.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT artist, groupName FROM torrents WHERE groupYear = 2012 AND releaseType LIKE 'Single' ORDER BY totalSnatched DESC LIMIT 1
Write SQL query to solve given problem: How many albums and Single-Tables were released by the artist named '50 cent' between 2010 and 2015?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT COUNT(id), ( SELECT COUNT(id) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'album' ) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'Single'
Write SQL query to solve given problem: An American rapper '2Pac' released his first solo album in 1991, how many years have passed until his next album was released?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT ( SELECT groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' ORDER BY groupYear LIMIT 1, 1 ) - groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' AND groupYear = 1991
Write SQL query to solve given problem: Find the average number of downloads for Single-Tables released by '2Pac' between 2001 and 2013.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT AVG(totalSnatched) FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'Single' AND groupYear BETWEEN 2001 AND 2013
Write SQL query to solve given problem: Provide the title, release year and the tag associated with the live album that has the highest number of downloads?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.groupName, T1.groupYear, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'live album' ORDER BY T1.totalSnatched DESC LIMIT 1
Write SQL query to solve given problem: Provide the name of artists who released at least two bootlegs in 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT artist FROM torrents WHERE groupYear = 2016 AND releaseType LIKE 'bootleg' GROUP BY artist HAVING COUNT(releaseType) > 2
Write SQL query to solve given problem: Which artist released singles between 1980 to 1982?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT artist FROM torrents WHERE groupYear BETWEEN 1980 AND 1982 AND releaseType LIKE 'single'
Write SQL query to solve given problem: Indicates groups with id from 10 to 20 with singles downloaded at least 20.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT groupName FROM torrents WHERE totalSnatched >= 20 AND releaseType LIKE 'single' AND id BETWEEN 10 AND 20
Write SQL query to solve given problem: Among the artists from 1980 to 1982. Which artist was tagged as "disco"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'disco' AND T1.groupYear BETWEEN 1980 AND 1982
Write SQL query to solve given problem: Provide the name of artists who had no more than 100 downloads and are tagged "funk" in 1980.. Keep the solution inside sql tag ```sql [SQL-Query] ```
music_tracker
SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.totalSnatched <= 100