Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Compare Performance Over Time | Ranking and Analytic Window Functions
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Window Functions in SQL

bookChallenge: Compare Performance Over Time

Tâche

Swipe to start coding

Write a query to display each employee's performance score for every review and show the difference in score compared to their previous review.

  • Select employee_id, name, review_date, and score for each performance review.
  • Use the LAG window function to access the previous review's score for the same employee, ordered by review_date.
  • Calculate the difference between the current score and the previous score for each review.
  • Name the difference column score_difference.
  • Ensure results are ordered by employee_id and review_date.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 6
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Compare Performance Over Time

Glissez pour afficher le menu

Tâche

Swipe to start coding

Write a query to display each employee's performance score for every review and show the difference in score compared to their previous review.

  • Select employee_id, name, review_date, and score for each performance review.
  • Use the LAG window function to access the previous review's score for the same employee, ordered by review_date.
  • Calculate the difference between the current score and the previous score for each review.
  • Name the difference column score_difference.
  • Ensure results are ordered by employee_id and review_date.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 6
single

single

some-alt