Sorting with ORDER BY
ORDER BY sorts your results.
Ascending (smallest to largest) - default:
Descending (largest to smallest):
Sort by multiple columns:
ORDER BY department_id, salary DESCThis sorts by department first, then by salary within each department.
Check your understanding
List all employees sorted by salary from highest to lowest.
Examples run on the employees sample database. Open any of them in the playground to experiment.