Pergunta de entrevista da empresa Protium

sql query on joins and window functions and subqueries