SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Rank All Employees by Salary

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

Problem Statement

Rank every employee by salary, highest first. When two employees share a salary they get the SAME rank, and the next rank is SKIPPED (1, 2, 2, 4 …). Show first_name, last_name, salary, salary_rank, ordered by salary_rank, employee_id ascending.

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: