Pergunta de entrevista da empresa FNZ

Sql query solving based on joins