#The default sort order in MySQL tables is ascending. Whenever we use ORDER BY clause to sort the rows in a table, MySQL gives the output in ascending order, with the smallest value first. Consider the following example from a table named "student" -
mysql> Select * from student order by name; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Aarav | 150 | M.SC | | Aryan | 165 | M.tech | | Gaurav | 100 | B.tech | +--------+--------+--------+ 3 rows in set (0.00 sec)
We can see that the above query gives the output, sorted by name, in ascending order, starting from the minimum value of the "Name" column.
The above is the detailed content of What is the default sort order in MySQL tables?. For more information, please follow other related articles on the PHP Chinese website!