db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
image_and_language
Name the most common predicate class of image ID 4434.
the most common predicate class of image ID 4434 MAX(PRED_CLASS) where IMG_ID = 4434;
SELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 4434 ORDER BY T2.PRED_CLASS DESC LIMIT 1
image_and_language
Count the number of 'dress' object classes and include their X and Y coordinates in image ID 1764.
dress' object classes refer to OBJ_CLASS = 'dress'; image ID 1764 refers to IMG_ID = 1764; X and Y refer to coordinates of the bounding box;
SELECT T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1764 AND T2.OBJ_CLASS = 'dress'
image_and_language
Give the X and Y coordinates of the sample object of image ID 23 that has the 'cast' attribute class.
X and Y refer to coordinates of the bounding box; image ID 23 refers to IMG_ID = 23; 'cast' attribute class refers to ATT_CLASS = 'cast';
SELECT T3.OBJ_SAMPLE_ID, T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.IMG_ID = 23 AND T1.ATT_CLASS = 'cast'
image_and_language
How many 'blue' attribute classes are there on image ID 2355735?
blue' attribute classes on image ID 2355735 refer to ATT_CLASS = 'blue' where IMG_ID = 2355735;
SELECT COUNT(T1.ATT_CLASS) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 2355735 AND T1.ATT_CLASS = 'blue'
image_and_language
What is the average width and height of the objects in image ID 47? List their object classes as well.
The bounding box's W and H abbreviations stand for the object's width and height in which average width and height refer to AVG(W) and AVG(H) respectively; image ID 47 refers to IMG_ID = 47; object classes refer to OBJ_CLASS;
SELECT T2.OBJ_CLASS, AVG(T1.W), AVG(T1.H) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 47 GROUP BY T2.OBJ_CLASS
hockey
List all players' given name who are good at both left and right hand and playing the forward position.
good at both left and right hand refers to shootCatch IS NULL;  playing the forward position refers to pos = 'F'
SELECT nameGiven FROM Master WHERE shootCatch IS NULL AND pos = 'F'
hockey
Who are the players who were not in the Hall of Fame list.
not in the Hall of Fame refers to hofID IS NULL
SELECT firstName, lastName FROM Master WHERE hofID IS NULL
hockey
Who is the youngest player who is still living. State the given name and date of birth.
still living refers to deathYear IS NULL; youngest refers to MAX(birthYear,birthMon,birthDay)
SELECT nameGiven , nameGiven , birthYear, birthMon, birthDay FROM Master WHERE deathYear IS NULL ORDER BY birthYear DESC, birthMon DESC, birthday DESC LIMIT 1
hockey
List all deceased goalies by last name. List the season where he had the most time played.
deceased refers to deathYear; most time played refers to MAX(Min)
SELECT T1.playerID, T2.year, Min FROM Master AS T1 INNER JOIN Goalies AS T2 ON T2.playerID = T1.playerID WHERE T1.deathYear IS NOT NULL ORDER BY T2.Min DESC LIMIT 1
hockey
State the nick name of player ID 'aubinje01'. List all the teams and season he played for.
nick name refers to nameNick; team refers to tmID; season refers to year
SELECT DISTINCT T1.nameNick, T3.year, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T1.playerID = 'aubinje01'
hockey
Name the deceased players whose death country is different from his birth country order by birth year.
death country is different from his birth country refers to birthCountry! = deathCountry
SELECT firstName, lastName FROM Master WHERE birthCountry != deathCountry ORDER BY birthYear
hockey
Who are the players played both in NHL and WHA. List the given name and first year they were in NHL and first year in WHA.
first year they were in NHL refers to firstNHL; first year in WHA refers to firstWHA; play in both refers to firstNHL IS NOT NULL AND firstWHA IS NOT NULL
SELECT nameGiven, firstNHL, firstWHA FROM Master WHERE firstNHL IS NOT NULL AND firstWHA IS NOT NULL
hockey
List the living players who have two positions. State their given name the position they play.
living players refers to deathYear IS NULL; positions refers to pos
SELECT firstName, lastName, pos FROM Master WHERE deathYear IS NULL AND pos LIKE '%/%'
hockey
State the nick name of the tallest player? If the player had left NHL, mention the last season he was with NHL.
nick name refers to nameNick; tallest player refers to MAX(height); had left NHL refers to lastNHL
SELECT nameNick, lastNHL FROM Master ORDER BY height DESC LIMIT 1
hockey
Name the goalies who are good at left hand and also has become a coach after retirement. Name all teams he had played before.
good at left hand refers to shootCatch = 'L'; goalies refers to pos = 'G'
SELECT DISTINCT firstName, lastName, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T1.playerID IS NOT NULL AND T2.coachID IS NOT NULL AND T2.shootCatch = 'L' AND T2.pos = 'G'
hockey
List all the deceased goalies and the teams he had played whose birth country was in Canada.
goalies refers to pos = 'G'; deceased goalies refers to deathYear IS NOT NULL
SELECT DISTINCT firstName, lastName, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T2.birthCountry = 'Canada' AND T2.deathYear IS NOT NULL AND T2.pos = 'G'
hockey
Name the goalies and season they played when Boston Bruins won number 1 in rank.
goalies refers to pos = 'G'; season refers to year
SELECT T1.firstName, T1.lastName, T3.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.year = T3.year AND T2.tmID = T3.tmID WHERE T1.deathYear IS NOT NULL AND T3.name = 'Boston Bruins' AND T3.rank = 1 AND T1.pos = 'G'
hockey
For all players who becomes coach after retirement, state the given name of coach and which teams and years did they coach?
SELECT DISTINCT T2.nameGiven, T3.name, T3.year FROM Coaches AS T1 INNER JOIN Master AS T2 ON T2.coachID = T1.coachID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T2.playerID IS NOT NULL AND T2.coachID IS NOT NULL
hockey
Among the coaches who was never a player, who has highest percentage of game winning? Provide the given name of the coach and team he coached.
highest percentage of game winning refers to MAX(DIVIDE(w,g)*100)
SELECT T2.nameGiven, T3.name FROM Coaches AS T1 INNER JOIN Master AS T2 ON T2.coachID = T1.coachID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T1.coachID IS NOT NULL ORDER BY CAST(T1.w AS REAL) / T1.g DESC LIMIT 1
hockey
Which coach has the best performance for team DET in history? What was the winning percentage? Name the coach and the year he coached.
winning percentage refers to DIVIDE(w,g)*100; team DET refers to tmID = 'DET'
SELECT CAST(T2.W AS REAL) / T2.G, T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN ( SELECT coachID FROM Coaches ORDER BY CAST(w AS REAL) / g DESC LIMIT 1 ) AS T3 ON T2.coachID = T3.coachID
hockey
Who is the coach who had coached the the most seasons in MTL? State his given name, date of birth and all teams he had coaches before.
date of birth refers to birthDay + birthMon + birthYear
SELECT T2.nameGiven , T2.birthYear, T2.birthMon, T2.birthDay, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T3.lgID = T1.lgID WHERE T3.tmID = 'MTL' GROUP BY T2.nameGiven, T2.birthYear, T2.birthMon, T2.birthDay, T3.name ORDER BY COUNT(T2.coachID) DESC LIMIT 1
hockey
List all goalies with more lost than won games for two seasons or more. State the name of the player and team he played.
lost refers to L; won refers to W
SELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.year = T3.year AND T2.tmID = T3.tmID WHERE T1.pos = 'G' AND T2.L > T2.W GROUP BY T1.firstName, T1.lastName, T3.name HAVING COUNT(T3.year) > 2
hockey
How many players and coaches are awarded after death?
awarded after death refers to note = 'posthumous'
SELECT COUNT(note) FROM AwardsMisc WHERE note IS NOT NULL
hockey
Among the players who won an award in the year 1983, how many of them play the position of goalie?
position of goalie refers to pos = 'G'
SELECT COUNT(playerID) FROM AwardsPlayers WHERE pos = 'G' AND year = 1983
hockey
How many coaches worked a temporary term in the year 2007?
worked a temporary term refers to notes = 'interim'
SELECT COUNT(coachID) FROM Coaches WHERE year = 2007 AND notes = 'interim'
hockey
How many teams scored against their opponent who had pulled their goalie in the year 2005?
teams scored against their opponent who had pulled their goalie refers to ENG is not null
SELECT COUNT(tmID) FROM Goalies WHERE year = 2005 AND ENG IS NULL
hockey
Please list the years in which the NHL League had shots recorded while the goalie was on the ice.
shots recorded while the goalie was on the ice refers to SA IS NOT NULL; NHL League refers to lgID = 'NHL'
SELECT DISTINCT year FROM Goalies WHERE lgID = 'NHL' AND SA IS NOT NULL
hockey
How many teams have the same total number of postseason wins and postseason loses?
same total number of postseason wins and postseason loses refers to PostW = PostL
SELECT DISTINCT COUNT(tmID) FROM Goalies WHERE PostW = PostL
hockey
Please list the name of the person who was in the Hall of Fame in the year 1978.
SELECT name FROM HOF WHERE year = 1978
hockey
How many people were in the Hall of Fame's Builder category?
SELECT COUNT(hofID) FROM HOF WHERE category = 'Builder'
hockey
Among the people who got into the Hall of Fame after the year 1980, how many of them belong to the category of "Player"?
after the year 1980 refers to year>1980
SELECT COUNT(hofID) FROM HOF WHERE year > 1980 AND category = 'Player'
hockey
Please list the Nicknames of the players who got in the Hall of Fame in 2007.
nicknames refers to nameNick
SELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T2.year = 2007
hockey
Please list the awards the coaches who are born in Canada have won.
born in Canada refers to birthCountry = 'Canada'
SELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.birthCountry = 'Canada'
hockey
Among the coaches whose team has over 30 wins in a year, how many of them are born in the USA?
over 30 wins refers to w>30; born in the USA refers to birthCountry = 'USA'
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'
hockey
Among the coaches who have taught teams from the NHL League, how many of them are from Canada?
from Canada refers to birthCountry = 'Canada'; NHL league refers to lgID = 'NHL'
SELECT COUNT(T2.coachID) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.lgID = 'NHL' AND T1.birthCountry = 'Canada'
hockey
Among the coaches who have received an award in 1940, how many of them are born in Toronto?
born in Toronto refers to birthCountry = 'Toronto'
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'
hockey
Among the coaches who have received an award after the year 1940, how many of them have already died?
after the year 1940 refers to year>1940; have already died refers to deathYear IS NOT NULL
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
hockey
Please list the awards won by coaches who taught the NHL League and have already died.
have already died refers to deathYear IS NOT NULL; NHL league refers to lgID = 'NHL'
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'
hockey
Please list the first name of the players who are good at both left hands and right hands for goalie and have gotten in the Hall of Fame.
good at both left hands and right hands for goalie refers to shootCatch IS NULL
SELECT DISTINCT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.shootCatch IS NULL
hockey
Among the players who became coaches, how many of them have gotten in the Hall of Fame?
players who became coaches refers to playerID IS NOT NULL AND coachID IS NOT NULL
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.playerID IS NOT NULL AND T1.coachID IS NOT NULL
hockey
Please list the birth cities of the players who have won an award in the year 1970.
SELECT DISTINCT T1.birthCity FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1970
hockey
How many players born in Toronto have won the All-Rookie award?
born in Toronto refers to birthCity = 'Toronto'
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'
hockey
Among the players who have won the All-Rookie award, how many of them have died?
have died refers to deathYear IS NOT NULL
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
hockey
Among the players who died in Massachussets, how many of them have won an award?
died in Massachussets refers to deathState = 'Massachussets'
SELECT COUNT(DISTINCT T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathState = 'MA'
hockey
Please list the awards the players who died in Arlington have won.
died in Arlington refers to deathCity = 'Arlington'
SELECT T2.award FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathCity = 'Kemptville'
hockey
Players born in which year have received the most awards in total?
received the most awards in total refers to max(count(award))
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
hockey
Which country is the most award-winning player from?
most award-winning refers to max(count(award)); country player is from refers to birthCountry
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
hockey
Which country has the most players in the Hall of Fame?
country refers to birthCountry
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
hockey
Please list the positions of the players who were born in Canada and have won the All-Rookie award.
born in Canada refers to birthCountry = 'Canada'; pos = 'LW' refers to left winger; pos = 'RW' refers to right winger; pos = 'C' refers to center; pos = 'G' refers to goalie; pos = 'D' refers to defenceman; pos = 'W' refers to winger; pos = 'F' refers to forward
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'
hockey
What is the percentage of American players among all the players who have gotten in the Hall of Fame?
percentage of American players = divide(count(hofID where birthCountry = 'USA'), count(hofID))*100%
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
hockey
How many years did player Id "healygl01" play?
years of playing = MAX(year)-MIN(year)
SELECT COUNT(year) FROM Goalies WHERE playerID = 'healygl01'
hockey
Which team did player Id "roypa01" play in 1992? Give the team id.
team id refers to tmID
SELECT tmID FROM Goalies WHERE playerID = 'roypa01' AND year = 1992
hockey
What was the total number of the games that player Id "rutlewa01" played in 1967?
total number of the games refers to GP
SELECT GP FROM Goalies WHERE playerID = 'rutlewa01' AND year = 1967
hockey
Show me how many minutes player Id "valiqst01" played in the game in 2007 season.
show me how many minutes refers to Min
SELECT Min FROM Goalies WHERE playerID = 'valiqst01' AND year = 2007
hockey
How many games did player Id "vanbijo01" win in the 1990 season?
the number of wins refers to W
SELECT W FROM Goalies WHERE playerID = 'vanbijo01' AND year = 1990
hockey
For the coach who won Second Team All-Star in 1933, how many wins did he have that year?
the number of wins refers to count(w)
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'
hockey
Which position did Mike Antonovich play?
pos = 'LW' refers to left winger; pos = 'RW' refers to right winger; pos = 'C' refers to center; pos = 'G' refers to goalie; pos = 'D' refers to defenceman; pos = 'W' refers to winger; pos = 'F' refers to forward
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'
hockey
For the coach who co-coached with Dave Lewis in 1998, where was his birth place?
co-coached refers to notes = 'co-coach'; birth place refers to 'birthCountry-birthState-birthCity'
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'
hockey
Which player who showed as the third goalie in a game has the biggest weight? Give the full name of the player.
the third goalie refers to stint = 3; the biggest weight refers to max(weight)
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
hockey
Which coach had the highest winning rates in the 2009 season? What's coach's nickname.
the highest winning rate refer to divide(W, sum(W, L))
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
hockey
In the Stanley Cup finals history, how many games did player id "broadpu01" play in 1922?
the number of games refers to GP
SELECT GP FROM ScoringSC WHERE playerID = 'broadpu01' AND YEAR = 1922
hockey
How many years did player Id "cleghsp01" make to the Stanley Cup finals?
the number of years refers to count(year)
SELECT COUNT(year) FROM ScoringSC WHERE playerID = 'cleghsp01'
hockey
What was the number of goals did player Id "dyeba01" make in the 1921 Stanley Cup finals?
the number of goals refers to G
SELECT G FROM ScoringSC WHERE playerID = 'dyeba01' AND year = 1921
hockey
Who made the most assists in a single game in the Stanley Cup finals ?
the most assists refers to max(A)
SELECT playerID FROM ScoringSC ORDER BY A DESC LIMIT 1
hockey
Which league did player id"adamsja01" play in 1920?
which league refers to lgID
SELECT lgID FROM ScoringSC WHERE playerID = 'adamsja01' AND year = 1920
hockey
What position did player id "hartgi01" play in his Stanley Cup finals performance?
position refers to pos
SELECT DISTINCT pos FROM ScoringSC WHERE playerID = 'hartgi01'
hockey
For the team which had three different goalies in the 2011 postseason games, how many games did they win in the regular season?
three different goalies refer to count(playerID) = 3; game won refers to W
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
hockey
Which year was the goalie who had the most postseaon shots Against in 2008 born?
the most postseason shots Against refers to max(PostSA); year born refers to birthYear
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
hockey
How many years were there after Don Waddell retired and became a coach in NHL?
after retired and became a coach refers to max(subtract(year, lastNHL))
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'
hockey
Which is the catching hand for the goaltender who had the most shutouts in 1996?
the most shutouts refers to max(SHO); catching hand for the goaltender refers to shootCatch; shootCatch = 'L' refers to lefthand; shootCatch = 'R' refers to righthand; shootCatch = 'null' or 'empty' means this player is good at both left and right hand
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
hockey
When was the birthday for the goalie who had most goal againsts in 1965 season?
Birthday refers to CONCAT(birthYear / birthMon / birthDate);most goal against refers to MAX(GA);1965 season refers to year = '1965'
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
hockey
How many shots on goal did Cam Neely had in the year of 1990?
1990 refers to the year played; Shot on goal refers to SOG
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'
hockey
What is the percentage of winning rate of improvement since Alain Vigneault became the coach of Vancouver Canucks in 2006 season?
winning rate refers to DIVIDE (w, SUM(w, l)); Vancouver Canucks is name of team where tmID = 'VAN' Winning rate refers to DIVIDE(wins in year = '2005/2006'(ADD(wins+loses); improvement refers to SUBTRACT(DIVIDE(wins in year = '2005'(ADD(wins+loses), DIVIDE(wins in year = '2006'(ADD(wins+loses))
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'
hockey
How many former athletes go on to become coaches after retiring?
SELECT COUNT(playerID) FROM Master WHERE playerID IS NOT NULL AND coachID IS NOT NULL
hockey
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.
penalty refers to BenchMinor; Ties refer to T
SELECT BenchMinor, name FROM Teams ORDER BY T DESC LIMIT 1
hockey
Which NHL award was most frequently won by the coach with the most wins?
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
hockey
How many players were included in the Hall of Fame on average between 1950 and 1980?
year BETWEEN 1950 and 1980; average = DIVIDE(COUNT(hofID)), 30)
SELECT CAST(COUNT(name) AS REAL) / 30 FROM HOF WHERE year BETWEEN 1950 AND 1980 AND category = 'Player'
hockey
Which team recorded the most number of road victories in 2005? Indicate the team ID.
road victories refers to rW; team id refers to tmID; victories and wins are synonyms
SELECT tmID FROM TeamSplits WHERE YEAR = '2005' ORDER BY rW DESC LIMIT 1
hockey
What is the position of the 9th oldest hockey player?
position refers to pos; date of birth refers to birthDay + birthMon + birthYear
SELECT pos FROM Master WHERE birthYear IS NOT NULL ORDER BY birthYear, birthMon, birthDay LIMIT 8
hockey
In 2006, what is the overall number of october defeats for the team with the most October defeats? Indicate the team ID.
team ID refers to tmID; 'defeats' and 'loses' are synonyms; most October defeats refers to max(OctL)
SELECT OctL, tmID FROM TeamSplits WHERE year = '2006' ORDER BY OctL DESC LIMIT 1
hockey
How many players, whose shooting/catching hand is both left and right, debuted their first NHL in 2011?
shooting/catching hand is both left and right refers to shootCatch is NULL, debuted their first NHL in 2011 refers to firstNHL = 2011
SELECT COUNT(playerID) FROM Master WHERE shootCatch IS NULL AND firstNHL = '2011'
hockey
What is the total amount of assists of the NHL player with the most assists in history? Please indicate his/her full name.
NHL refers to lgID = 'NHL'; most assists refers to max(A); full name = nameGiven + lastName; total amount of assists = sum(A(playerID(max(A))))
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
hockey
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.
least number of penalty kill chances refers to min(PKC); power play percentage refers to (PP%) = divide(PPG, PPC); team playing refers to tmID; victorious team refers to tmIDWinner; team victorious refers to tmID = tmIDWinner and vice versa
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
hockey
What is the name of the losing team during an exhibition game in 1912?
exhibition game refers to note = 'EX'; team of losing team refers to tmIDLoser
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'
hockey
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?
penalty minutes refers to PIM; year of scoring BETWEEN 2003 AND 2005; most number of games played refers to max(GP)
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
hockey
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.
position has won the most awards refers to pos(max(count(award))); most recent player refers to playerID(pos(max(count(award)))& max(year)); full name = nameGiven + lastName
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
hockey
How many games did the coach who received the first-ever Second Team All-Star award play before receiving such award?
first-ever Second Team All-Star award refers to min(year(award = 'Second Team All-Star')); How many games before receiving such award = sum(g(coachID(min(year(award = 'Second Team All-Star')))): g(min(year)))
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
hockey
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.
team playing refers to tmID; oppositng team refers to oppID; victories' and 'wins' are synonyms; most victories refers to max(w)
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
hockey
In 1997, how many loss did the coach have who temporary coached Tampa Bay Lightning? Indicate his/her coach ID.
temporary coached refers to notes = 'interim'; number of loss refers to L (to add)
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
hockey
What is the name of the coach whose team placed 4th in the 1969 game? Indicate their coachID.
name of coach refers to coachID; placed 4th refers to rank = 4; 1969 game refers to year = 1969
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
hockey
Between 1917 to 1920, what are the names of the team who ranked first in the first half of the season each year?
year BETWEEN 1917 AND 1920; first half of season refers to half = 1
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
hockey
What is the highest total points a team got in a year?
the highest total points = MAX(Pts)
SELECT SUM(Pts), year FROM Teams GROUP BY year, tmID ORDER BY SUM(Pts) DESC LIMIT 1
hockey
Among the teams that had more wins than loses in the year 2006, how many of them have over 100 points?
more wins than loses refers to W > L; over 100 points refers to Pts > 100
SELECT COUNT(tmID) FROM Teams WHERE year = 2006 AND W > L AND Pts > 100
hockey
Which team had the highest penalty kill chances in 1995, Florida Panthers, Edmonton Oilers or Los Angeles Kings?
the highest penalty kill chances refer to MAX(PKC); year = 1995;
SELECT name FROM Teams WHERE year = 1995 AND name IN ('Florida Panthers', 'Edmonton Oilers', 'Los Angeles Kings') ORDER BY PKC DESC LIMIT 1
hockey
What is the name of the team that got more wins than loses in the Stanley Cup finals in 1917?
more wins than loses refers to W>L; year = 1917;
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
hockey
Please list the teams that have played in 1922's Stanley Cup finals.
teams refer to tmID; year = 1922;
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'
hockey
Among the teams that played in 1922's Stanley Cup finals, how many of them had over 20 points in that year?
how many teams refer to COUNT(tmID); over 20 points refer to Pts>20; year = 1922;
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
hockey
What were the penalty minutes in 1923's Stanley Cup finals of the team that ranked second in that year?
teams refer to tmID; year = 1922; ranked second refers to rank = 2; penalty minutes refer to PIM;
SELECT T1.PIM FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1923' AND T2.rank = 2
hockey
Which team got the most wins in the Stanley Cup finals?
team refers name; most wins = MAX(W);
SELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year GROUP BY T2.name ORDER BY SUM(T1.W) DESC LIMIT 1
hockey
How many wins did the Philadelphia Flyers have over the Boston Bruins in 1985?
Philadelphia Flyers is name of team playing; Boston Bruins is name of opposing team where oppID = 'BOS'; year = 1985; wins refer to W;
SELECT T1.W FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1985 AND T1.tmID = ( SELECT DISTINCT tmID FROM Teams WHERE name = 'Philadelphia Flyers' ) AND T1.oppID = ( SELECT DISTINCT tmID FROM Teams WHERE name = 'Boston Bruins' )