problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: Among the players that weigh more than 90 kg, how many of them have a position of defense?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.position_info = 'D' |
Write SQL query to solve given problem: Among the players that weigh more than 90 kg, what is the name of the player that has the most attendance in the player's first 7 years of NHL career?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.sum_7yr_GP = ( SELECT MAX(T1.sum_7yr_GP) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 ) |
Write SQL query to solve given problem: What is the weight of the player with the longest time on ice in the player’s first 7 years of NHL career in kilograms?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.sum_7yr_TOI = ( SELECT MAX(t.sum_7yr_TOI) FROM PlayerInfo t ) |
Write SQL query to solve given problem: How much taller is David Bornhammar than Pauli Levokari in centimeters?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar' ) - ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'Pauli Levokari' ) |
Write SQL query to solve given problem: Among all the players that are right-shooted, how many of them weigh over 90 kg?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R' |
Write SQL query to solve given problem: Please list the names of all the players that are over 90 kg and are right-shooted.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R' |
Write SQL query to solve given problem: What is the BMI of David Bornhammar?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(T2.weight_in_kg AS REAL) / (CAST(T3.height_in_cm AS REAL) / 100 * (CAST(T3.height_in_cm AS REAL) / 100)) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T1.PlayerName = 'David Bornhammar' |
Write SQL query to solve given problem: What is the average height in centimeters of all the players in the position of defense?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(SUM(T2.height_in_cm) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.position_info = 'D' |
Write SQL query to solve given problem: What is the weight in pounds of the heaviest player?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT MAX(T2.weight_in_lbs) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id |
Write SQL query to solve given problem: How many right-shooted players have a height of 5'7''?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch = '5''7"' AND T1.shoots = 'R' |
Write SQL query to solve given problem: Among the players whose total NHL games played in their first 7 years of NHL career is no less than 500, what is the name of the player who committed the most rule violations?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.sum_7yr_GP > 500 ORDER BY T2.PIM DESC LIMIT 1 |
Write SQL query to solve given problem: What is the height in centimeter of the tallest player born in Edmonton, Alberta, Canada?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.birthplace = 'Edmonton, AB, CAN' ORDER BY T2.height_in_cm DESC LIMIT 1 |
Write SQL query to solve given problem: How many players, who were drafted by Anaheim Ducks in 2008, have played for U.S. National U18 Team?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.overallby = 'Anaheim Ducks' AND T1.draftyear = 2008 AND T2.TEAM = 'U.S. National U18 Team' |
Write SQL query to solve given problem: What is the weight in kilograms of the player with the highest number of goal differential of all time?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T3.weight_in_kg FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN weight_info AS T3 ON T2.weight = T3.weight_id ORDER BY T1.PLUSMINUS DESC LIMIT 1 |
Write SQL query to solve given problem: Who is the most valuable player in QMJHL league during the 2004-2005 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON BETWEEN '2004' AND '2005' AND T1.LEAGUE = 'QMJHL' ORDER BY T1.P DESC LIMIT 1 |
Write SQL query to solve given problem: What are the names of the players who played for Acadie-Bathurst Titan during the regular season in 1998-1999?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1998-1999' AND T1.GAMETYPE = 'Regular Season' AND T1.TEAM = 'Acadie-Bathurst Titan' |
Write SQL query to solve given problem: How many games did the tallest player have ever played?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.GP FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.ELITEID = ( SELECT t.ELITEID FROM PlayerInfo t ORDER BY t.height DESC LIMIT 1 ) |
Write SQL query to solve given problem: Who is the youngest player to have played during the 1997-1998 season for OHL League?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1997-1998' AND T1.LEAGUE = 'OHL' ORDER BY T2.birthdate DESC LIMIT 1 |
Write SQL query to solve given problem: Among the players who played 72 games, how many are left-shooters?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T2.ELITEID) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.GP = 72 AND T2.shoots = 'L' |
Write SQL query to solve given problem: What is the difference in the number of goals scored by Pavel Brendl during the regular season versus the playoffs in the 1998-1999 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T3.Rs_G - T4.Pf_G AS diff FROM ( SELECT T2.PlayerName, T1.G AS Rs_G FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Pavel Brendl' AND T1.SEASON = '1998-1999' AND T1.GAMETYPE = 'Regular Season' ) AS T3 INNER JOIN ( SELECT T2.PlayerName, T1.G AS Pf_G FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Pavel Brendl' AND T1.SEASON = '1998-1999' AND T1.GAMETYPE = 'Playoffs' ) AS T4 ON T3.PlayerName = T4.PlayerName |
Write SQL query to solve given problem: What is the average weight in pounds of all the players with the highest prospects for the draft?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(SUM(T2.weight_in_lbs) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.CSS_rank = ( SELECT MAX(CSS_rank) FROM PlayerInfo ) |
Write SQL query to solve given problem: Among all the teams that made the playoffs in the 2007-2008 season, identify the percentage that played over 20 games.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(COUNT(CASE WHEN GP > 20 THEN TEAM ELSE NULL END) AS REAL) * 100 / COUNT(TEAM) FROM SeasonStatus WHERE SEASON = '2007-2008' AND GAMETYPE = 'Playoffs' |
Write SQL query to solve given problem: Name the player who scored the most goals in a single game in the 2007-2008 season of WHL?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.LEAGUE = 'WHL' ORDER BY T1.G DESC LIMIT 1 |
Write SQL query to solve given problem: Name the Chilliwack Chiefs players who have scored 100 points or more in the NHL.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.TEAM = 'Chilliwack Chiefs' AND T1.P >= 100 |
Write SQL query to solve given problem: Identify the players who weigh 120 kg.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T1.weight_in_kg = 120 |
Write SQL query to solve given problem: Identify the players with the same height as Brian Gionta. How tall are they?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName, T1.height_in_cm FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.height = ( SELECT height FROM PlayerInfo WHERE PlayerName = 'Brian Gionta' ) |
Write SQL query to solve given problem: Identify the name and position of the player who has committed the most rule violations.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName, T2.position_info FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.PIM = ( SELECT MAX(PIM) FROM SeasonStatus ) |
Write SQL query to solve given problem: Among all players drafted by the Toronto Maple Leafs, identify the percentage who are from Eastern Europe.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(COUNT(CASE WHEN nation IN ('Belarus', 'Czech Rep.', 'Slovakia', 'Ukraine') THEN ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(ELITEID) FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs' |
Write SQL query to solve given problem: Among all players drafted by the Toronto Maple Leafs in 2008, identify the player with the highest prospects for the draft.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT PlayerName FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs' AND draftyear = '2008' ORDER BY CSS_rank DESC LIMIT 1 |
Write SQL query to solve given problem: Name the player and his team who made the playoffs in the 2006-2007 season of SuperElit league with the highest points.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName, T1.TEAM FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2006-2007' AND T1.GAMETYPE = 'Playoffs' AND T1.LEAGUE = 'SuperElit' ORDER BY T1.P DESC LIMIT 1 |
Write SQL query to solve given problem: How many players who were drafted by the Toronto Maple Leafs have played over 300 games in their first 7 years of the NHL career?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(ELITEID) FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs' AND sum_7yr_GP > 300 |
Write SQL query to solve given problem: How tall is the player from Yale University who picked up 28 penalty minutes in the 2005-2006 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T3.height_in_cm FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T2.height = T3.height_id WHERE T1.SEASON = '2005-2006' AND T1.TEAM = 'Yale Univ.' AND T1.PIM = 28 |
Write SQL query to solve given problem: Among all goals scored by Calgary Hitmen in the 2007-2008 season, identify the percentage scored by Ian Schultz.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(SUM(CASE WHEN T2.PlayerName = 'Ian Schultz' THEN T1.G ELSE 0 END) AS REAL) * 100 / SUM(T1.G) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.TEAM = 'Calgary Hitmen' |
Write SQL query to solve given problem: Among all penalty minutes picked up by Ak Bars Kazan in the 1999-2000 season, identify the percentage picked up by Yevgeni Muratov.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(SUM(CASE WHEN T2.PlayerName = 'Yevgeni Muratov' THEN T1.PIM ELSE 0 END) AS REAL) * 100 / SUM(T1.PIM) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1999-2000' AND T1.TEAM = 'Ak Bars Kazan' |
Write SQL query to solve given problem: What is the birthplace of Aaron Gagnon?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT birthplace FROM PlayerInfo WHERE PlayerName = 'Aaron Gagnon' |
Write SQL query to solve given problem: What is the weight in kg of Tony Martensson?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'Tony Martensson' |
Write SQL query to solve given problem: List out the name of players who weight 190 lbs.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_lbs = 190 |
Write SQL query to solve given problem: Who has the heaviest weight?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id ORDER BY T2.weight_in_kg DESC LIMIT 1 |
Write SQL query to solve given problem: What is the percentage of players who were born in Denmark and weight above 154 lbs?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(COUNT(CASE WHEN T1.nation = 'Denmark' AND T2.weight_in_lbs > 154 THEN T1.ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id |
Write SQL query to solve given problem: List out the nation of players who played for the 1997-1998 season .. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT T2.nation FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1997-1998' |
Write SQL query to solve given problem: What is the highest point highest point of Per Mars in the draft year?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.P FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Per Mars' ORDER BY T1.P DESC LIMIT 1 |
Write SQL query to solve given problem: Among the Italian players, who has the shortest height?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.nation = 'Italy' ORDER BY T1.height_in_cm ASC LIMIT 1 |
Write SQL query to solve given problem: List out the name of players who have a height of 5'8".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T1.height_in_inch = '5''8"' |
Write SQL query to solve given problem: How many players were born in 1982 and have a height above 182cm?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T1.height_in_cm > 182 AND strftime('%Y', T2.birthdate) = '1982' |
Write SQL query to solve given problem: What is the percentage of Russian players who have a height of under 200 inch?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(COUNT(CASE WHEN T1.height_in_cm < 200 AND T2.nation = 'Russia' THEN T2.ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height |
Write SQL query to solve given problem: Among the USA players, who has the lightest weight?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T2.nation = 'USA' ORDER BY T1.weight_in_lbs ASC LIMIT 1 |
Write SQL query to solve given problem: Who among the players in season 2000-2001 has committed the highest rule violations or penalty minutes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' ORDER BY T1.PIM DESC LIMIT 1 |
Write SQL query to solve given problem: List the names of all players in team Avangard Omsk in season 2000-2001.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.TEAM = 'Avangard Omsk' |
Write SQL query to solve given problem: Who among the players drafted by Arizona Coyotes in 2000 has committed the highest rule violations?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.overallby = 'Arizona Coyotes' AND T2.draftyear = 2000 ORDER BY T1.PIM DESC LIMIT 1 |
Write SQL query to solve given problem: How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195 |
Write SQL query to solve given problem: List the names of all players from Avangard Omsk that have played for playoffs in season 2000-2001.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.TEAM = 'Avangard Omsk' AND T1.GAMETYPE = 'Playoffs' |
Write SQL query to solve given problem: Who is the most valuable player who played in the 2000-2001 season of the International league?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' ORDER BY T1.P DESC LIMIT 1 |
Write SQL query to solve given problem: How many players who were born in 1980 weigh 185 in pounds?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T2.ELITEID) FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T1.weight_in_lbs = 185 AND strftime('%Y', T2.birthdate) = '1980' |
Write SQL query to solve given problem: Who has played the most game plays in the 2000-2001 season of the International league?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' ORDER BY T1.GP DESC LIMIT 1 |
Write SQL query to solve given problem: List the names of all players from Avangard Omsk who played in the 2000-2001 season of the International league that have no goals in draft year.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' AND T1.TEAM = 'Czech Republic (all)' AND T1.G = 0 |
Write SQL query to solve given problem: Who is the oldest player who played for Avangard Omsk during the regular season in 2000-2001?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.GAMETYPE = 'Regular Season' AND T1.TEAM = 'Avangard Omsk' ORDER BY T2.birthdate ASC LIMIT 1 |
Write SQL query to solve given problem: Among the players who played in OHL league during the regular season in 2007-2008, who is the player that attained the most number of assist?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.LEAGUE = 'OHL' AND T1.GAMETYPE = 'Regular Season' ORDER BY T1.A DESC LIMIT 1 |
Write SQL query to solve given problem: How many teams did the heaviest player drafted by Arizona Coyotes have played for?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT COUNT(T2.TEAM) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN weight_info AS T3 ON T1.weight = T3.weight_id WHERE T1.overallby = 'Arizona Coyotes' ORDER BY T3.weight_in_lbs DESC LIMIT 1 |
Write SQL query to solve given problem: Calculate the average weight in pounds of all players drafted by Arizona Coyotes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(SUM(T1.weight_in_lbs) AS REAL) / COUNT(T2.ELITEID) FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T2.overallby = 'Arizona Coyotes' |
Write SQL query to solve given problem: Calculate the average height in centimeter of all players who played in Acadie-Bathurst Titan during regular season.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(SUM(T1.height_in_cm) AS REAL) / COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height INNER JOIN SeasonStatus AS T3 ON T2.ELITEID = T3.ELITEID WHERE T3.TEAM = 'Acadie-Bathurst Titan' AND T3.GAMETYPE = 'Regular Season' |
Write SQL query to solve given problem: How many games did Per Mars play in the 1997-1998 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.GP FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON = '1997-1998' AND T1.PlayerName = 'Pavel Patera' |
Write SQL query to solve given problem: How heavy is Matthias Trattnig in kilograms?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'Pavel Patera' |
Write SQL query to solve given problem: List the name of players who have a height over 5'9.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '5''9"' |
Write SQL query to solve given problem: What team did Niklas Eckerblom play in the 1997-1998 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T2.TEAM FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON = '1997-1998' AND T1.PlayerName = 'Niko Kapanen' |
Write SQL query to solve given problem: Which team has the most Swedish?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T.TEAM FROM ( SELECT T2.TEAM, COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.nation = 'Sweden' GROUP BY T2.TEAM ORDER BY COUNT(DISTINCT T1.ELITEID) DESC LIMIT 1 ) AS T |
Write SQL query to solve given problem: Name the player who had the most goals for team Rimouski Oceanic in playoff.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Rimouski Oceanic' AND T2.GAMETYPE = 'Playoffs' ORDER BY T2.G DESC LIMIT 1 |
Write SQL query to solve given problem: Which country do most players of team Plymouth Whalers come from?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T.nation FROM ( SELECT T1.nation, COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Plymouth Whalers' GROUP BY T1.nation ORDER BY COUNT(T1.ELITEID) DESC LIMIT 1 ) AS T |
Write SQL query to solve given problem: Who had the most assists of team Plymouth Whalers in the 1999-2000 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Plymouth Whalers' AND T2.SEASON = '1999-2000' ORDER BY T2.A DESC LIMIT 1 |
Write SQL query to solve given problem: Indicate the height of all players from team Oshawa Generals in inches.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T3.height_in_inch FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'Oshawa Generals' |
Write SQL query to solve given problem: Who is the oldest player that participated in OHL league in the 1997 - 2000 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL' AND T2.SEASON = '1999-2000' ORDER BY T1.birthdate LIMIT 1 |
Write SQL query to solve given problem: Who is the tallest player in team USA U20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT T.PlayerName FROM ( SELECT T1.PlayerName, T3.height_in_cm FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'USA U20' ORDER BY T3.height_in_cm DESC ) AS T WHERE T.height_in_cm = ( SELECT MAX(T3.height_in_cm) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'USA U20' ) |
Write SQL query to solve given problem: What is the percentage of Swedish players in playoffs games in the 1997 - 2000 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT DISTINCT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T1.ELITEID ELSE NULL END) OVER (PARTITION BY T2.SEASON) AS REAL) * 100 / COUNT(T1.ELITEID) OVER (PARTITION BY T2.SEASON) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON IN ('1997-1998', '1998-1999', '1999-2000') |
Write SQL query to solve given problem: Calculate the percentage of penalty minutes of Swedish players in OHL league among all players.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | ice_hockey_draft | SELECT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T2.PIM ELSE NULL END) AS REAL) * 100 / COUNT(*) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL' |
Write SQL query to solve given problem: What is the average standard cost of product number CA-1098?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT AVG(T2.StandardCost) FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductNumber = 'CA-1098' |
Write SQL query to solve given problem: List the products whereby the standard cost is $80 more than previous standard cost in history.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.StandardCost - T2.StandardCost > 80 GROUP BY T1.Name |
Write SQL query to solve given problem: Name all products and total quantity for each item for shopping cart ID 14951.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name, T2.Quantity FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ShoppingCartID = 14951 |
Write SQL query to solve given problem: List the product name with more than 5 quantity in the shopping cart.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 5 |
Write SQL query to solve given problem: Provide all the transactions whereby the quantiy is more than 10,000 pieces. State the product name and the selling price.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT DISTINCT T1.Name, T1.ListPrice FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 10000 |
Write SQL query to solve given problem: Which is a high quality product but with the lowest transacted quantity?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Class = 'H' ORDER BY T2.Quantity ASC LIMIT 1 |
Write SQL query to solve given problem: How much would be the total sales profit for shopping cart ID 20621 ?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT SUM((T1.ListPrice - T1.StandardCost) * T2.Quantity) FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ShoppingCartID = 20621 |
Write SQL query to solve given problem: Which product line has the most products that are salable?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT ProductLine FROM Product WHERE FinishedGoodsFlag = 1 GROUP BY ProductLine ORDER BY COUNT(FinishedGoodsFlag) DESC LIMIT 1 |
Write SQL query to solve given problem: State the product name, product line, rating and the selling price of product with the lowest rating.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name, T1.ProductLine, T2.Rating, T1.ListPrice FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID ORDER BY T2.Rating ASC LIMIT 1 |
Write SQL query to solve given problem: Calculate the profit of each products. List all products with more than $100 in profit.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT DISTINCT Name FROM Product WHERE ListPrice - StandardCost > 100 |
Write SQL query to solve given problem: List the purchase order whereby all received quantity were rejected? Name those product.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.RejectedQty = T2.ReceivedQty AND T2.RejectedQty <> 0 |
Write SQL query to solve given problem: Among all products without any rejected quantity, which product has the highest line total? State the product name and unit price.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name, T2.UnitPrice FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.RejectedQty = 0 ORDER BY T2.LineTotal DESC LIMIT 1 |
Write SQL query to solve given problem: List all product names and its product line for all purchase order with order quantity of 5000 or more.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name, T1.ProductLine FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderQty > 4999 |
Write SQL query to solve given problem: Among the low quality product, which product has the highest line total? List the product name and its line total?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name, T2.LineTotal FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE Class = 'L' ORDER BY OrderQty * UnitPrice DESC LIMIT 1 |
Write SQL query to solve given problem: Which product has the highest profit on net? State the product name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID ORDER BY T2.LastReceiptCost - T2.StandardPrice DESC LIMIT 1 |
Write SQL query to solve given problem: List all products with minimum order quantity of 100 and order them by product name in descending order.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT DISTINCT T1.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MinOrderQty = 100 ORDER BY T1.Name DESC |
Write SQL query to solve given problem: List the name and calculate its profit for product with the highest rating in review.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.Name, T1.ListPrice - T1.StandardCost FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID ORDER BY T2.Rating DESC LIMIT 1 |
Write SQL query to solve given problem: What is the total profit all transactions with product ID 827?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT SUM((T1.ListPrice - T1.StandardCost) * T2.Quantity) FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 827 |
Write SQL query to solve given problem: Which currency pair's average exchange rate for the day is the highest?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT FromCurrencyCode, ToCurrencyCode FROM CurrencyRate ORDER BY AverageRate DESC LIMIT 1 |
Write SQL query to solve given problem: How many products with the highest unit price were ordered?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT OrderQty FROM PurchaseOrderDetail ORDER BY UnitPrice DESC LIMIT 1 |
Write SQL query to solve given problem: Between Northwest and Southeast of the United States, which territory one recorded the highest amount of sales last year?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT Name FROM SalesTerritory WHERE CountryRegionCode = 'US' AND (Name = 'Northwest' OR Name = 'Southeast') ORDER BY SalesLastYear DESC LIMIT 1 |
Write SQL query to solve given problem: What is the full name of the Document Control Manager who is in charge of all Level 1 approved documents?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.FirstName, T1.MiddleName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Document AS T3 ON T3.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Manager' AND T3.DocumentLevel = 1 AND T3.Status = 2 GROUP BY T1.FirstName, T1.MiddleName, T1.LastName |
Write SQL query to solve given problem: Which customer has the highest subtotal amount of sales orders whose assigned to the salesperson with the highest bonus?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.CustomerID FROM SalesOrderHeader AS T1 INNER JOIN SalesPerson AS T2 ON T1.SalesPersonID = T2.BusinessEntityID ORDER BY T1.SubTotal DESC LIMIT 1 |
Write SQL query to solve given problem: What is the total price of Sales Order ID 46625 with Volume Discount 11 to 14 and Product ID 716?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.UnitPrice * T2.OrderQty FROM SpecialOffer AS T1 INNER JOIN SalesOrderDetail AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID WHERE T1.Description = 'Volume Discount 11 to 14' AND T1.SpecialOfferID = 2 AND T2.ProductID = 716 AND T2.SalesOrderID = 46625 |
Write SQL query to solve given problem: Of the products that has a reorder inventory point of no more than 600, how many manufactured in-house products that takes 1 day to manufacture with BOM Level 4 are there?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT COUNT(T1.ProductID) FROM Product AS T1 INNER JOIN BillOfMaterials AS T2 ON T1.ProductID = T2.ProductAssemblyID WHERE T1.MakeFlag = 1 AND T1.DaysToManufacture = 1 AND T2.BOMLevel = 4 AND T1.ReorderPoint <= 600 |
Write SQL query to solve given problem: What is the highest amount of bonus earned by the sales person in Canada?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Bonus FROM SalesTerritory AS T1 INNER JOIN SalesPerson AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.CountryRegionCode = 'CA' ORDER BY T2.SalesQuota DESC LIMIT 1 |
Write SQL query to solve given problem: What are the names of the product that has the lowest rating?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating ASC LIMIT 1 ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.