Morgan Stanley interview question

Question SQL Joins