ORDER BY ASC sorts query results from lower to higher values. For numbers, this means smallest to largest; for text, alphabetical order; and for dates, earliest to latest.
Sorting helps analysts understand and present data in a meaningful order.
An analyst may sort employees by salary from the lowest salary to the highest salary.
SELECT
EmployeeName,
Salary
FROM Employees
ORDER BY Salary ASC;
Ascending sorting is useful for salary analysis, dates, transaction amounts, product prices, and alphabetical lists.
- ASC means ascending order.
- ASC is the default ORDER BY direction in many databases.
- Numbers are sorted from low to high.
- Dates are sorted from earliest to latest.
- Text is generally sorted alphabetically.
What does ASC mean in SQL?
ASC means ascending order and sorts values from lower to higher or earliest to latest.
Is ASC always required with ORDER BY?
No. ASC is commonly the default sort direction, so it can often be omitted.