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
Window Functions in SQL

bookChallenge: Compare Performance Over Time

Oppgave

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

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 6
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

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: Compare Performance Over Time

Sveip for å vise menyen

Oppgave

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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 6
single

single

some-alt