Beginner

347. ORDER BY ASC

Learn how to sort query results in ascending order.

📘 Lesson 347 of 728 ⏱ 8 min 🎯 Beginner

ORDER BY ASC sorts query results from lower to higher values for numeric data and from earlier to later or alphabetically depending on the data type.

Sorting makes query results easier to understand and is essential for ranking, reporting, and analysis.

Display employees from the lowest salary to the highest salary.

SQL
SELECT
    EmployeeName,
    Salary
FROM Employees
ORDER BY Salary ASC;

Ascending sorting is useful for salary analysis, dates, transaction values, customer names, and operational reports.

  • ASC means ascending order.
  • ASC is the default ORDER BY direction in many databases.
  • Numbers normally go from low to high.
  • Text is commonly sorted alphabetically.
  • Dates are commonly sorted from earlier to later.
What does ASC mean?

ASC means ascending order.

Is ASC required in every ORDER BY query?

No. ASC is commonly the default sort direction, so it can often be omitted.

Have you finished this lesson?

Introduction to SQL – All Lessons