Pergunta de entrevista da empresa NITS

Sql question related to windows Function and the difference between CTE and Subquery