SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Assign Row Numbers to Employees by Salary

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

Problem Statement

Give each employee a unique row number, highest salary first. Break ties on employee_id ascending so the result is reproducible. Show first_name, last_name, salary, row_num, ordered by row_num.

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: