Skip to main content
SQL • LESSON 59

Top Results

How can we find the five highest-paid employees?

Beginner3 Minutes720 XP
🤔 THE QUESTION

How can we find the five highest-paid employees?

💡 WHAT IS IT?

Combining ORDER BY DESC with LIMIT N retrieves the top N records ranked by a specified metric.

🎯 WHAT IS IT USED FOR?

Top 5 sales performers, highest volume transactions, fastest processing times.

💻 EXAMPLE
SELECT name, salary
FROM employees
ORDER BY salary DESC
LIMIT 5;

🎯 Mission Objectives

Practice typing production-grade SQL code for Top Results.

  • Top-N query
  • ORDER BY DESC + LIMIT
  • Leaderboard pattern
  • Salary ranking