Table: nhl_game_stats_31
Columns: date
visitor
score
home
record

Question: Who was the visiting team when the record was 6–12–5–1?
SQL: SELECT "visitor" FROM nhl_game_stats_31 WHERE "record" = '6–12–5–1'

Question: Who was the home team when the record was 21–45–8–5?
SQL: SELECT "home" FROM nhl_game_stats_31 WHERE "record" = '21–45–8–5'