Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Salary Progression Analysis | Ranking and Analytic Window Functions
Window Functions in SQL

bookChallenge: Salary Progression Analysis

Oppgave

Swipe to start coding

Write a query to analyze how each employee's current salary compares to the earliest salary in their department. Your query must return the following columns for each employee:

  • employee_id
  • name
  • department
  • salary
  • The earliest salary in the employee's department, based on the earliest hire_date
  • The difference between the employee's salary and the department's earliest salary.

Steps:

  • Use a window function to find the earliest salary in each department, ordered by hire_date.
  • Calculate the difference between each employee's salary and the department's earliest salary.
  • Return all required columns for each employee.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 7
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 this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Salary Progression Analysis

Sveip for å vise menyen

Oppgave

Swipe to start coding

Write a query to analyze how each employee's current salary compares to the earliest salary in their department. Your query must return the following columns for each employee:

  • employee_id
  • name
  • department
  • salary
  • The earliest salary in the employee's department, based on the earliest hire_date
  • The difference between the employee's salary and the department's earliest salary.

Steps:

  • Use a window function to find the earliest salary in each department, ordered by hire_date.
  • Calculate the difference between each employee's salary and the department's earliest salary.
  • Return all required columns for each employee.

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 7
single

single

some-alt