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?
- A.
DESC
- B.
ASC
- C.
There is no default value
- D.
More than one of the above
- 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.