Salary growth of 12%+: departments 14–20, Jan 2023–Dec 2024
Instructions
Consider the salary_history records with changed_at on or after January 1, 2023 and strictly before January 1, 2025. For each employee who has such records, take the earliest salary by date (first_salary) and the latest by date (last_salary) among them. Find employees of the departments with department_id from 14 to 20 inclusive whose last_salary grew relative to first_salary by at least 12% (last_salary >= first_salary * 1.12). Output id, name, first_salary, last_salary and growth_pct, the growth as a percentage of first_salary, rounded to 1 decimal place. Row order does not matter.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Table relationships
- N:1Many-to-one
employees.→department_id departments.id - N:1Many-to-one
employees.→manager_id employees.id - N:1Many-to-one
departments.→parent_id departments.id - N:1Many-to-one
salary_history.→employee_id employees.id
Table data
Select a table in the diagram or list to view its rows.