Pergunta de entrevista da empresa Petal

SQL aggregation and window function questions applied to a certain dataset