Pergunta de entrevista da empresa Mathnasium

One advanced CTE Sql question was given