Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære 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

Opgave

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.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 6
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Compare Performance Over Time

Stryg for at vise menuen

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 6
single

single

some-alt