

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- How can I change the default sort order of MySQL tables?
- Is there a default ORDER BY value in MySQL?
- What Is the Default MySQL Port Number?
- 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 alias to Show Tables in MySQL Result?
- What is the Default Gateway?
- What is the default type of a hexadecimal value in MySQL?
- Call aggregate function in sort order with MySQL
- What is the use of ORDER BY clause 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?
- What is the default constructor in C#?
- What happens to MySQL temporary tables if MySQL session is ended?
Advertisements