Suggest an editImprove this articleRefine the answer for “How do you sort data in descending order?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To sort data **in descending order**, use the `ORDER BY` operator with the `DESC` keyword: larger values come first, then smaller ones, e.g. `ORDER BY salary DESC` returns employees from the highest salary to the lowest. **Key point:** you can sort by several columns at once, e.g. `ORDER BY department ASC, salary DESC` - first by department, then within each one, by salary.Shown above the full answer for quick recall.Answer (EN)ImageTo sort data **in descending order**, use the `ORDER BY` operator with the `DESC` (*descending*) keyword. This is the opposite of ascending order: **larger values** come first, then **smaller** ones. ### Example ```sql SELECT name, salary FROM employees ORDER BY salary DESC; ``` SQL returns employees starting with **the highest salary** and ending with **the lowest**. ### How it works - For **numbers**, from larger to smaller (5000, 2000, 1000). - For **dates**, from later to earlier (2025-10-21 -> 2025-01-01). - For **text**, in reverse alphabetical order (Z, Y, X...). ### You can sort by several columns ```sql SELECT name, department, salary FROM employees ORDER BY department ASC, salary DESC; ``` Sorts by department first (alphabetically), then within each department, by salary from largest to smallest. **Summary:** `ORDER BY ... DESC` is a way to output data **from the largest to the smallest**. It's used for rankings, top lists, most-recent dates, and any "largest" values.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.