problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Please list the Nicknames of the players who got in the Hall of Fame in 2007.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T2.year = 2007
Write SQL query to solve given problem: Did the tallest player got in the Hall of Fame? If yes, please list the year when he got in the Hall of Fame.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CASE WHEN T1.hofID IS NULL THEN 'NO' ELSE T2.year END FROM Master AS T1 LEFT JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.height = ( SELECT MAX(height) FROM Master )
Write SQL query to solve given problem: Please list the awards the coaches who are born in Canada have won.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.birthCountry = 'Canada'
Write SQL query to solve given problem: Among the coaches whose team has over 30 wins in a year, how many of them are born in the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T2.coachID) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.W > 30 AND T1.birthCountry = 'USA'
Write SQL query to solve given problem: Please list the awards won by coaches who were born in 1952.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.birthYear = 1952
Write SQL query to solve given problem: Among the coaches who have received an award in 1940, how many of them are born in Toronto?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T1.coachID) FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1940 AND T1.birthCity = 'Toronto'
Write SQL query to solve given problem: Among the coaches who have received an award after the year 1940, how many of them have already died?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T1.coachID) FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.deathYear IS NOT NULL AND T2.year > 1940
Write SQL query to solve given problem: Please list the awards won by coaches who taught the NHL League and have already died.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.deathYear IS NOT NULL AND T2.lgID = 'NHL'
Write SQL query to solve given problem: Among the coaches who have gotten in the Hall of Fame, how many of them have a weight of over 195?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT T1.coachID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.weight > 195
Write SQL query to solve given problem: Please list the birth cities of the players who have won an award in the year 1970.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.birthCity FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1970
Write SQL query to solve given problem: How many players born in Toronto have won the All-Rookie award?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthCity = 'Toronto'
Write SQL query to solve given problem: Among the players who have won the All-Rookie award, how many of them have died?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.deathYear IS NOT NULL
Write SQL query to solve given problem: Please list the awards the players who died in Arlington have won.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.award FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathCity = 'Kemptville'
Write SQL query to solve given problem: Please list the nicknames of the players who have won the All-Rookie award and are born in March.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthMon = 3
Write SQL query to solve given problem: Among the players who were born in July and August, how many of them got in the Hall of Fame?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.birthMon IN (7, 8)
Write SQL query to solve given problem: In which month was the player who has won the most awards born?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthMon FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T2.playerID ORDER BY COUNT(T2.award) DESC LIMIT 1
Write SQL query to solve given problem: Players born in which year have received the most awards in total?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthYear FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthYear ORDER BY COUNT(T2.award) DESC LIMIT 1
Write SQL query to solve given problem: Which country is the most award-winning player from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthCountry FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthCountry ORDER BY COUNT(T2.award) DESC LIMIT 1
Write SQL query to solve given problem: Which country has the most players in the Hall of Fame?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthCountry FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID GROUP BY T1.birthCountry ORDER BY COUNT(T1.playerID) DESC LIMIT 1
Write SQL query to solve given problem: Please list the positions of the players who were born in Canada and have won the All-Rookie award.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'Canada' AND T2.award = 'All-Rookie'
Write SQL query to solve given problem: What is the average BMI of all the coaches who have gotten in the Hall of Fame?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T1.weight / (T1.height * T1.height)) / COUNT(T1.coachID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID
Write SQL query to solve given problem: What is the percentage of American players among all the players who have gotten in the Hall of Fame?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(COUNT(CASE WHEN T1.birthCountry = 'USA' THEN T1.playerID ELSE NULL END) AS REAL) * 100 / COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID
Write SQL query to solve given problem: How many years did player Id "healygl01" play?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(year) FROM Goalies WHERE playerID = 'healygl01'
Write SQL query to solve given problem: Which team did player Id "roypa01" play in 1992? Give the team id.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT tmID FROM Goalies WHERE playerID = 'roypa01' AND year = 1992
Write SQL query to solve given problem: What was the total number of the games that player Id "rutlewa01" played in 1967?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT GP FROM Goalies WHERE playerID = 'rutlewa01' AND year = 1967
Write SQL query to solve given problem: Show me how many minutes player Id "valiqst01" played in the game in 2007 season.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT Min FROM Goalies WHERE playerID = 'valiqst01' AND year = 2007
Write SQL query to solve given problem: How many games did player Id "vanbijo01" win in the 1990 season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT W FROM Goalies WHERE playerID = 'vanbijo01' AND year = 1990
Write SQL query to solve given problem: In how many games did player Id "vernomi01" end up with a tie or an overtime loss in the 1998 season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT `T/OL` FROM Goalies WHERE playerID = 'vernomi01' AND year = 1998
Write SQL query to solve given problem: For the coach who won Second Team All-Star in 1933, how many wins did he have that year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T1.W) FROM Coaches AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1933 AND T2.award = 'Second Team All-Star'
Write SQL query to solve given problem: Did legendsID "P194502" personally attend his Hall of Fame dedication?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT IIF(T1.note = 'posthumous', 'YES', 'NO') FROM AwardsMisc AS T1 RIGHT JOIN Master AS T2 ON T1.ID = T2.playerID WHERE T2.legendsID = 'P194502'
Write SQL query to solve given problem: Which position did Mike Antonovich play?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Mike' AND T1.lastName = 'Antonovich'
Write SQL query to solve given problem: For the coach who co-coached with Dave Lewis in 1998, where was his birth place?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthCountry FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1998 AND T2.notes = 'co-coach with Dave Lewis'
Write SQL query to solve given problem: Which player who showed as the third goalie in a game has the biggest weight? Give the full name of the player.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.stint = 3 ORDER BY T1.weight DESC LIMIT 1
Write SQL query to solve given problem: Among the players who had 10 empty net goals in their career, who is the tallest? Show his full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID GROUP BY T2.playerID, T1.height HAVING SUM(T2.ENG) > 10 ORDER BY T1.height DESC LIMIT 1
Write SQL query to solve given problem: For the goalie who had the most shutouts in 2010, what's his catching hand?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.shootCatch FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2010 GROUP BY T2.playerID ORDER BY SUM(T2.SHO) DESC LIMIT 1
Write SQL query to solve given problem: Who is the youngest goalie among those who had more than 150 goal againsts in 2002 season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2002 AND T2.GA > 150 GROUP BY T2.playerID, T1.birthYear, T1.birthMon, T1.birthMon HAVING SUM(T2.GA) ORDER BY T1.birthYear DESC, T1.birthMon DESC, SUM(T1.birthDay) DESC LIMIT 1
Write SQL query to solve given problem: In the history of team id NJD, which goalie saved the most goal attempts? Give his full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'NJD' GROUP BY T2.playerID ORDER BY SUM(T2.SA - T2.GA) DESC LIMIT 1
Write SQL query to solve given problem: Which teams had the most postseason empty net goals in 2010 season? List their team names.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.name FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID WHERE T1.year = 2010 GROUP BY T2.name ORDER BY SUM(PostENG) DESC LIMIT 1
Write SQL query to solve given problem: For the team which had the most postseason shutouts in 1995, how many points did they have that year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T2.SHO) FROM Scoring AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1995 GROUP BY T2.tmID ORDER BY SUM(T2.PostSHO) DESC LIMIT 1
Write SQL query to solve given problem: Which coach had the highest winning rates in the 2009 season? What's coach's nickname.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.coachID, T1.nameNick FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 2009 ORDER BY CAST(T2.W AS REAL) / (T2.W + T2.L) DESC LIMIT 1
Write SQL query to solve given problem: For the team had the biggest power play percentage in 2011, who was their coach that season? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID WHERE T2.year = 2011 ORDER BY CAST(T2.PPG AS REAL) / T2.PPC DESC LIMIT 1
Write SQL query to solve given problem: In the Stanley Cup finals history, how many games did player id "broadpu01" play in 1922?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT GP FROM ScoringSC WHERE playerID = 'broadpu01' AND YEAR = 1922
Write SQL query to solve given problem: How many years did player Id "cleghsp01" make to the Stanley Cup finals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(year) FROM ScoringSC WHERE playerID = 'cleghsp01'
Write SQL query to solve given problem: What was the number of goals did player Id "dyeba01" make in the 1921 Stanley Cup finals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT G FROM ScoringSC WHERE playerID = 'dyeba01' AND year = 1921
Write SQL query to solve given problem: Who made the most assists in a single game in the Stanley Cup finals ?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT playerID FROM ScoringSC ORDER BY A DESC LIMIT 1
Write SQL query to solve given problem: Which league did player id"adamsja01" play in 1920?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT lgID FROM ScoringSC WHERE playerID = 'adamsja01' AND year = 1920
Write SQL query to solve given problem: What position did player id "hartgi01" play in his Stanley Cup finals performance?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT pos FROM ScoringSC WHERE playerID = 'hartgi01'
Write SQL query to solve given problem: For the team which had three different goalies in the 2011 postseason games, how many games did they win in the regular season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T2.W) FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID WHERE T2.year = 2011 GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) = 3
Write SQL query to solve given problem: Which year was the goalie who had the most postseaon shots Against in 2008 born?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthYear FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2008 ORDER BY T2.PostSA DESC LIMIT 1
Write SQL query to solve given problem: How many years were there after Don Waddell retired and became a coach in NHL?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT MAX(T2.year) - MIN(T2.year) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.firstName = 'Don' AND T1.lastName = 'Waddell'
Write SQL query to solve given problem: Which is the catching hand for the goaltender who had the most shutouts in 1996?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.shootCatch FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1996 ORDER BY T2.SHO DESC LIMIT 1
Write SQL query to solve given problem: When was the birthday for the goalie who had most goal againsts in 1965 season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.birthYear, T1.birthMon, birthDay FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1965 ORDER BY T2.GA DESC LIMIT 1
Write SQL query to solve given problem: For he who had the highest plus / minus on the court in the 1981 season, what's his full name?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1981 GROUP BY T2.playerID ORDER BY SUM(T2.`+/-`) DESC LIMIT 1
Write SQL query to solve given problem: What's the weight of the player who had the most Power Play Goals in the 21st century?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.weight FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year > 2000 GROUP BY T1.playerID, T1.weight ORDER BY SUM(T2.PPG) DESC LIMIT 1
Write SQL query to solve given problem: For the player who scored 7 shorthanded goals in 1989, what's his dominant hand?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.shootCatch FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1989 GROUP BY T2.playerID HAVING SUM(T2.SHG) = 7
Write SQL query to solve given problem: Who was the most clutch player in 1986? Give his full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1986 GROUP BY T2.playerID ORDER BY SUM(T2.GWG) DESC LIMIT 1
Write SQL query to solve given problem: How many shots on goal did Cam Neely had in the year of 1990?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.SOG FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Cam' AND T1.lastName = 'Neely' AND T2.year = '1990'
Write SQL query to solve given problem: Who was the coach for the team which had the most bench minors penalty in 2003?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T3.firstName, T3.lastName FROM Teams AS T1 INNER JOIN Coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T2.coachID = T3.coachID WHERE T1.year = '2003' GROUP BY T3.firstName, T3.lastName ORDER BY SUM(T1.BenchMinor) DESC LIMIT 1
Write SQL query to solve given problem: For the goalies whose weight are above 190, who had most goal againsts in 1978 season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.playerID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = '1978' AND T2.weight > 190 ORDER BY T1.GA DESC LIMIT 1
Write SQL query to solve given problem: What is the percentage of winning rate of improvement since Alain Vigneault became the coach of Vancouver Canucks in 2006 season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(CASE WHEN T1.year = 2006 THEN CAST(T1.W AS REAL) * 100 / (T1.W + T1.L) ELSE 0 END) - ( SELECT CAST(W AS REAL) * 100 / (W + L) FROM Teams WHERE year = '2005' AND name = 'Vancouver Canucks' ) FROM Teams AS T1 INNER JOIN Coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T2.coachID = T3.coachID WHERE T1.name = 'Vancouver Canucks' AND T3.firstName = 'Alain' AND T3.lastName = 'Vigneault'
Write SQL query to solve given problem: For the goalie who had the highest defensive success rate in the postseason of 2011, what's his legends ID ?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.legendsID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2011 ORDER BY 1 - CAST(T1.PostGA AS REAL) / T1.PostSA DESC LIMIT 1
Write SQL query to solve given problem: Among the teams with the most number of ties, how many penalty was committed by a player or coach that is not on the ice? Indicate the name of the team.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT BenchMinor, name FROM Teams ORDER BY T DESC LIMIT 1
Write SQL query to solve given problem: Which NHL award was most frequently won by the coach with the most wins?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT award FROM Teams AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.lgID = T2.lgID WHERE T1.lgID = 'NHL' GROUP BY T2.coachID, T2.award ORDER BY COUNT(T2.award) DESC LIMIT 1
Write SQL query to solve given problem: What is the power play percentage of the team with the most number of loses?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(SUM(PPG) AS REAL) * 100 / SUM(PPC) FROM Teams GROUP BY tmID ORDER BY SUM(L) DESC LIMIT 1
Write SQL query to solve given problem: How many players were included in the Hall of Fame on average between 1950 and 1980?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(COUNT(name) AS REAL) / 30 FROM HOF WHERE year BETWEEN 1950 AND 1980 AND category = 'Player'
Write SQL query to solve given problem: Which country produced the most number of hockey players? Identify which year was most of the hockey players are born.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT birthCountry, birthYear FROM Master GROUP BY birthCountry, birthYear ORDER BY COUNT(birthCountry) DESC LIMIT 1
Write SQL query to solve given problem: How many wins does the team have whose goaltender have the most number of successfully stopping the other team from scoring during the entire game?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(W) FROM Goalies GROUP BY tmID ORDER BY SUM(SHO) DESC LIMIT 1
Write SQL query to solve given problem: Which team recorded the most number of road victories in 2005? Indicate the team ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT tmID FROM TeamSplits WHERE YEAR = '2005' ORDER BY rW DESC LIMIT 1
Write SQL query to solve given problem: What is the position of the 9th oldest hockey player?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT pos FROM Master WHERE birthYear IS NOT NULL ORDER BY birthYear, birthMon, birthDay LIMIT 8
Write SQL query to solve given problem: How many goals were scored while the goalkeeper was on the ice in the 1924 WCHL by the goalie with the most goals scored?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(PostGA) FROM Goalies WHERE lgID = 'WCHL' AND year = '1924' GROUP BY playerID ORDER BY SUM(PostGA) DESC LIMIT 1
Write SQL query to solve given problem: In 2006, what is the overall number of october defeats for the team with the most October defeats? Indicate the team ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT OctL, tmID FROM TeamSplits WHERE year = '2006' ORDER BY OctL DESC LIMIT 1
Write SQL query to solve given problem: How many players, whose shooting/catching hand is both left and right, debuted their first NHL in 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(playerID) FROM Master WHERE shootCatch IS NULL AND firstNHL = '2011'
Write SQL query to solve given problem: Which year recorded the most number of goals by a player and how old was the player at the time the most number of goals was achieved by him?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.year, T1.year - T2.birthYear FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID GROUP BY T1.year, T1.year - T2.birthYear ORDER BY SUM(T1.G) DESC LIMIT 1
Write SQL query to solve given problem: What is the average height of all the goalies born in the 70s who's a left shooting/catching dominant and to which team do the tallest player/s play for most recently?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(SUM(T2.height) AS REAL) / COUNT(*) FROM AwardsPlayers AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.height IS NOT NULL AND (T2.pos = 'LW' OR T2.pos = 'L/C')
Write SQL query to solve given problem: What is the total amount of assists of the NHL player with the most assists in history? Please indicate his/her full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T1.A), T2.firstName, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NHL' GROUP BY T2.firstName, T2.lastName ORDER BY SUM(T1.A) DESC LIMIT 1
Write SQL query to solve given problem: What is the power play percentage of the team with the least number of penalty kill chances and to which team were they playing against? Indicate whether the team lost or victorious.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T1.A), T2.firstName, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NHL' GROUP BY T2.firstName, T2.lastName ORDER BY SUM(T1.A) DESC LIMIT 1
Write SQL query to solve given problem: What are the awards won by the coach who coached the team with the most number of victories of all time? Indicate the choach ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T2.coachID, T1.award FROM AwardsCoaches AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID GROUP BY T2.coachID, T1.award ORDER BY SUM(T2.w) DESC LIMIT 1
Write SQL query to solve given problem: What is the name of the losing team during an exhibition game in 1912?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.name FROM SeriesPost AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND tmIDLoser = tmID WHERE T1.note = 'EX' AND T2.year = '1912'
Write SQL query to solve given problem: How long has the NHL player been playing during the year when he recorded the least number of times being on the ice when a goal is scored for the team versus against the team? Indicate his full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T3.firstNHL - T1.year, T3.nameGiven , T3.firstName, T3.lastName FROM Scoring AS T1 INNER JOIN Teams AS T2 ON T2.tmID = T1.tmID INNER JOIN Master AS T3 ON T1.playerID = T3.playerID GROUP BY T3.firstName, T3.lastName, T3.nameGiven, T3.firstNHL - T1.year, T3.firstName, T3.lastName ORDER BY SUM(T1.`+/-`) ASC LIMIT 1
Write SQL query to solve given problem: Between 2003 to 2005, what are the given names of the players with the most number of games played whose Penalty minutes is between 200 to 250?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.nameGiven FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID AND T1.PIM BETWEEN 200 AND 250 AND T1.year BETWEEN 2003 AND 2005 ORDER BY T1.GP DESC LIMIT 1
Write SQL query to solve given problem: How old was the goaltender who scored the fewest goals while on the ice when he retired from the NHL?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.lastNHL - T2.birthYear FROM GoaliesSC AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.lastNHL IS NOT NULL GROUP BY T2.lastNHL, T2.birthYear ORDER BY SUM(GA) LIMIT 1
Write SQL query to solve given problem: Which position has won the most awards and who is the most recent player that was awarded with an award in that position? Indicate the name of the award and the full name of the player.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.pos, T2.award, T1.nameGiven, T1.lastName FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T2.coachID = T1.coachID GROUP BY T1.pos, T2.award, T1.nameGiven, T1.lastName ORDER BY COUNT(T2.award) LIMIT 1
Write SQL query to solve given problem: How many games did the coach who received the first-ever Second Team All-Star award play before receiving such award?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T1.g) FROM Coaches AS T1 INNER JOIN ( SELECT coachID, year FROM AwardsCoaches WHERE award = 'Second Team All-Star' ORDER BY year LIMIT 1 ) AS T2 ON T1.coachID = T2.coachID AND T1.year < T2.year
Write SQL query to solve given problem: How many teams did the team with the most victories in 1915 play against? Indicate the name of the team who won the most games in 1915, as well as the names of the opposing team.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT oppID), T2.tmID, T2.oppID FROM Teams AS T1 INNER JOIN TeamVsTeam AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.year = 1915 GROUP BY T2.tmID, T2.oppID ORDER BY SUM(T2.W) DESC LIMIT 1
Write SQL query to solve given problem: Among the teams whose shorthanded goals are between 1 to 5, which player is the most trustworthy in the critical moment?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.nameGiven, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.SHG BETWEEN 1 AND 5 ORDER BY T1.GWG DESC LIMIT 1
Write SQL query to solve given problem: In 1997, how many loss did the coach have who temporary coached Tampa Bay Lightning? Indicate his/her coach ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T1.l), T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.notes = 'interim' AND T1.year = '1997' AND T2.name = 'Tampa Bay Lightning' GROUP BY T1.coachID
Write SQL query to solve given problem: Among the players whose short handed assists are greater or equal to 7, what is the final standing of the team with the most number of assists? Indicate the year to which the most number of assists was achieved and the name of the team.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.rank, T2.year, T2.name FROM Scoring AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.SHA >= 7 ORDER BY T1.A DESC LIMIT 1
Write SQL query to solve given problem: What is the name of the coach whose team placed 4th in the 1969 game? Indicate their coachID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1969 AND T2.rank = 4
Write SQL query to solve given problem: Between 1917 to 1920, what are the names of the team who ranked first in the first half of the season each year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T2.name FROM TeamsHalf AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.half = 1 AND T1.rank = 1 AND T1.year BETWEEN 1917 AND 1920
Write SQL query to solve given problem: How many Canadian players, between the ages of 18 and 24 when they initially played their first NHL, had a cumulative goal total of no more than 5? Indicate their complete names, the year, and the team for which they scored the specified amount of goals.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.nameGiven, T2.lastName, T2.birthYear, birthMon, birthDay , T3.tmID FROM Scoring AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T3.tmID = T1.tmID WHERE (T2.firstNHL - T2.birthYear) BETWEEN 18 AND 24 AND T3.G < 5
Write SQL query to solve given problem: How many bench minor penalties did the team St. Louis Blues got in total in all the games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(SUM(BenchMinor) AS REAL) / 2 FROM Teams WHERE name = 'St. Louis Blues'
Write SQL query to solve given problem: What is the power play chances of New York Rangers in 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(PPG AS REAL) / PPC FROM Teams WHERE year = 2009 AND name = 'New York Rangers'
Write SQL query to solve given problem: What is the highest total points a team got in a year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(Pts), year FROM Teams GROUP BY year, tmID ORDER BY SUM(Pts) DESC LIMIT 1
Write SQL query to solve given problem: Among the teams that had more wins than loses in the year 2006, how many of them have over 100 points?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(tmID) FROM Teams WHERE year = 2006 AND W > L AND Pts > 100
Write SQL query to solve given problem: Which team got the most bench minor penalties in 2006?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT name FROM Teams WHERE year = 2006 GROUP BY tmID, name ORDER BY CAST(SUM(BenchMinor) AS REAL) / 2 DESC LIMIT 1
Write SQL query to solve given problem: Please list the first 3 teams that got the most penalty minutes in 2006.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT name FROM Teams WHERE year = 2006 GROUP BY tmID, name ORDER BY SUM(PIM) DESC LIMIT 3
Write SQL query to solve given problem: Which team had the highest penalty kill chances in 1995, Florida Panthers, Edmonton Oilers or Los Angeles Kings?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT name FROM Teams WHERE year = 1995 AND name IN ('Florida Panthers', 'Edmonton Oilers', 'Los Angeles Kings') ORDER BY PKC DESC LIMIT 1
Write SQL query to solve given problem: What is the name of the team that got more wins than loses in the Stanley Cup finals in 1917?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1917' AND T1.W > T1.L
Write SQL query to solve given problem: Please list the teams that have played in 1922's Stanley Cup finals.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1922'
Write SQL query to solve given problem: Among the teams that played in 1922's Stanley Cup finals, how many of them had over 20 points in that year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(T1.tmID) FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1922' AND T2.Pts > 20