If we have not specified ASC or DESC after an SQL ORDER BY clause, which of…

2023

If we have not specified ASC or DESC after an SQL ORDER BY clause, which of the following is used by default?

  1. A.

    DESC

  2. B.

    ASC

  3. C.

    There is no default value

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 1646 students.

Show answer & explanation

Correct answer: B

In SQL, the ORDER BY clause is used to sort the result set. When no sorting order (ASC or DESC) is specified, the database uses a default sorting order. The default order in most SQL databases, including MySQL, PostgreSQL, and SQLite, is ascending (ASC). This means that if you do not specify ASC or DESC, the data will be sorted in ascending order by default. Therefore, the correct answer is ASC.

Explore the full course: Up Lt Grade Assistant Teacher 2025