Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Rolling 3-Month Spend per Customer | Advanced Window Function Applications
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Window Functions in SQL

bookChallenge: Rolling 3-Month Spend per Customer

Tarea

Swipe to start coding

Calculate the rolling 3-month average performance score for each employee, ordered by review_date.

  • For each row in the performance table, compute the average of score for the current and previous reviews by the same employee that occurred within the same 3-month window (including the current row).
  • Use a window function with appropriate partitioning and ordering to achieve this.
  • The result must include the columns employee_id, review_date, score, and the computed rolling 3-month average score as a new column named rolling_3_month_avg_score.
  • The results must be ordered by employee_id and review_date.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain that in simpler terms?

What are the main benefits of this approach?

Are there any common mistakes to avoid with this?

close

bookChallenge: Rolling 3-Month Spend per Customer

Desliza para mostrar el menú

Tarea

Swipe to start coding

Calculate the rolling 3-month average performance score for each employee, ordered by review_date.

  • For each row in the performance table, compute the average of score for the current and previous reviews by the same employee that occurred within the same 3-month window (including the current row).
  • Use a window function with appropriate partitioning and ordering to achieve this.
  • The result must include the columns employee_id, review_date, score, and the computed rolling 3-month average score as a new column named rolling_3_month_avg_score.
  • The results must be ordered by employee_id and review_date.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
single

single

some-alt