Pregunta de entrevista de Petal

SQL aggregation and window function questions applied to a certain dataset