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

bookChallenge: Salary Progression Analysis

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 7
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

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

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 7
single

single

some-alt