ASC

SQL ASC Keyword

The ASC keyword in SQL is used with the ORDER BY clause to sort the result set in ascending order. This means values will be arranged from the lowest to the highest (A–Z for text, 0–9 for numbers, and earliest to latest for dates).

If no sorting keyword is specified, ASC is used by default.

Tutorials dojo strip

SQL ASC Syntax

SQL

SQL ASC Example with Patients Table

The following SQL statement selects all columns from the Patients table, sorted by the last_name column in ascending order.

This query will return all patient records and arrange them alphabetically by their last names, from A to Z.

SQL

SQL ASC Labs

Tutorials dojo strip