S&P Global interview question

sql joins, a puzzle, inheritance