SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Show Salary Difference Between Current and Next Higher Salary

Build mastery in Ranking Nth Value with this scenario-based SQL challenge and live execution support.

Problem Statement

Write a query to show each employee's salary and the next higher salary (by employee_id). Use LEAD window function.

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: