- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the default sort order in MySQL tables?
The default sort order in MySQL tables is ascending. Whenever we use ORDER BY clause to sort out the rows of a table, MySQL gives 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 the query above gives the output, ordered by name, in ascending order, start with smallest value ‘Name’ column.
- Related Articles
- How can I change the default sort order of MySQL tables?
- Is there a default ORDER BY value in MySQL?
- How to get the list of tables in default MySQL database?
- Implement Custom Sort Order in MySQL
- MySQL show tables sort by table name?
- What Is the Default MySQL Port Number?
- Call aggregate function in sort order with MySQL
- What is the alias to Show Tables in MySQL Result?
- Sort by date & time in descending order in MySQL?
- Write a MySQL query equivalent to “SHOW TABLES” in sorted order?
- How can we sort MySQL output in descending order?
- How can we sort MySQL output in ascending order?
- What is the default type of a hexadecimal value in MySQL?
- What is the use of OPTIMIZE TABLE statement in maintaining the MySQL tables?
- What is the use of CHECK TABLE statement in maintaining the MySQL tables?

Advertisements