Pergunta de entrevista da empresa The Blackstone Group

SQL question was based on Joining different tables and query optimisation