SQL · Pattern 1 — Basic Data Retrieval
ORDER BY
Without ORDER BY, a database can return rows in any order it finds convenient — nothing guarantees insertion order.
Source data — Pattern 1: Basic Data Retrieval
All queries run against the shared employees table (see schema.sql).

What it does
Without ORDER BY, a database can return rows in any order it finds convenient — nothing guarantees insertion order. ORDER BY column DESC (or ASC, the default) is the only reliable way to control row order in the result.
Problem
Display employees sorted by salary in descending order.
SELECT first_name, last_name, salary
FROM employees
ORDER BY salary DESC;
Result
