Scenario SQL Question
Year-over-Year Salary Growth (LAG on History)
Build mastery in Ctes Window with this scenario-based SQL challenge and live execution support.
Problem Statement
From salaries_history, for each employee ordered by effective_date, show the previous salary and the YoY growth % vs that previous record (rounded to 2; NULL for the first record). Return employee_id, effective_date, salary, prev_salary, yoy_growth_pct — ordered by employee_id, effective_date.
Relevant Tables
salaries_history
SQL Concepts Used in This Scenario
Strengthen your understanding with these targeted learning topics: