Skip to main content
SQL โ€ข LESSON 54

ORDER BY DESC

How can we show the highest salaries first?

Beginnerโฑ 3 Minutesโญ 670 XP
๐Ÿค” THE QUESTION

How can we show the highest salaries first?

๐Ÿ’ก WHAT IS IT?

The DESC keyword reverses sorting order from highest to lowest or Z to A.

๐ŸŽฏ WHAT IS IT USED FOR?

Leaderboards, finding recent timestamps, top compensation analysis.

๐Ÿ’ป EXAMPLE
SELECT name, salary
FROM employees
ORDER BY salary DESC;

๐ŸŽฏ Mission Objectives

Practice typing production-grade SQL code for ORDER BY DESC.

  • โœ“ DESC keyword
  • โœ“ Descending order
  • โœ“ Top-value ranking
  • โœ“ Sorting syntax