Challenge: Rolling 3-Month Spend per Customer
Aufgabe
Swipe to start coding
Calculate the rolling 3-month average performance score for each employee, ordered by review_date.
- For each row in the
performancetable, compute the average ofscorefor 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 namedrolling_3_month_avg_score. - The results must be ordered by
employee_idandreview_date.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 3. Kapitel 2
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
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?
Großartig!
Completion Rate verbessert auf 4.55
Challenge: Rolling 3-Month Spend per Customer
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
Calculate the rolling 3-month average performance score for each employee, ordered by review_date.
- For each row in the
performancetable, compute the average ofscorefor 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 namedrolling_3_month_avg_score. - The results must be ordered by
employee_idandreview_date.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 3. Kapitel 2
single