Skip to main content
SQL • LESSON 53

ORDER BY

How can we sort employees by salary?

Beginner3 Minutes660 XP
🤔 THE QUESTION

How can we sort employees by salary?

💡 WHAT IS IT?

ORDER BY sorts the returned query result set in ascending order by default.

🎯 WHAT IS IT USED FOR?

Alphabetical sorting, lowest-to-highest numerical sequencing, chronological timeline ordering.

💻 EXAMPLE
SELECT name, salary
FROM employees
ORDER BY salary;

🎯 Mission Objectives

Practice typing production-grade SQL code for ORDER BY.

  • ORDER BY
  • Ascending sort
  • Numeric ordering
  • Result formatting