S&P Global interview question

Sql basic query, puzzles, data structures