Browse SQL Topics ▼

ASC vs DESC Sort Directions

📂 Sorting & Pagination 📘 Lesson 29 of 81

Control sorting directions explicitly with ASC (lowest to highest) and DESC (highest to lowest).

ASC vs DESC Sort Directions is an essential topic in SQL and relational database engineering.

Overview

Building on foundational principles introduced in orderby, mastering asc vs desc sort directions provides the core mental model and practical query skills needed for production relational database engineering.

-- Ascending (default): A to Z, 1 to 100, oldest to newest
SELECT * FROM products ORDER BY price ASC;

-- Descending: Z to A, 100 to 1, newest to oldest
SELECT * FROM products ORDER BY price DESC;

Key Concepts

  • Understand the fundamental syntax, conventions, and mental model.
  • Avoid common beginner traps, data type mismatches, and performance pitfalls.
  • Apply practical idioms directly in production applications.

[!TIP] Master this concept to build a rock-solid foundation. Next, proceed to multi-column-sorting.

Test your understanding of ASC vs DESC Sort Directions

Quick interactive practice questions with instant feedback.

Take Quiz →