Pergunta de entrevista da empresa Cognizant

Sql question with joins , and select statement