Suggest an editImprove this articleRefine the answer for “What do ASC and DESC do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)`ASC` and `DESC` are **sort directions** in SQL, used together with the `ORDER BY` operator: `ASC` (ascending) sorts from smaller to larger, `DESC` (descending) sorts from larger to smaller. **Key point:** `ASC` can be omitted since it's the default; for numbers `ASC` goes from smaller to larger, for dates from older to newer, for text alphabetically.Shown above the full answer for quick recall.Answer (EN)Image`ASC` and `DESC` are **sort directions** in SQL, used together with the `ORDER BY` operator. ### `ASC`, ascending Sorts **from smaller to larger**: - numbers, from 1 to 1000, - dates, from older to newer, - text, alphabetically (A -> Z). ```sql SELECT name, salary FROM employees ORDER BY salary ASC; ``` Returns employees starting with the lowest salary. *(`ASC` can be omitted, since it's the default value.)* ### `DESC`, descending Sorts **from larger to smaller**: - numbers, from 1000 to 1, - dates, from newer to older, - text, in reverse order (Z -> A). ```sql SELECT name, salary FROM employees ORDER BY salary DESC; ``` Returns employees with the highest salary first. **Summary:** - `ASC` -> from smaller to larger (ascending); - `DESC` -> from larger to smaller (descending). Both set the **sort direction** after `ORDER BY`.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.