A connector is employed when we have to use MySQL with other programming languages. The work of MySQL-connector is to provide access to MySQL Driver to the required language. Thus, it generates a connection between the programming language and the MySQL Server.
OrderBy is used to arrange the result set in either ascending or descending order. By default, it is always in ascending order unless “DESC” is mentioned, which arranges it in descending order.
“ASC” can also be used to explicitly arrange it in ascending order. But, it is generally not done this way since default already does that.
SELECT column1, column2 FROM table_name ORDER BY column_name ASC|DESC;
The following programs will help you understand this better.
DATABASE IN USE:
Example 1: Program to arrange the data in ascending order by name
Example 2: Arranging the database in descending order
Example 3: Program to get namefrom the table, arranged in descending order by Roll no.
- Python MySQL - Where Clause
- Python MySQL - Limit Clause
- Connect MySQL database using MySQL-Connector Python
- Python MySQL - Join
- MySQL-Connector-Python module in Python
- Python MySQL - Select Query
- Python MySQL - Create Database
- Python MySQL - Drop Table
- Python MySQL - Insert into Table
- Python MySQL - Delete Query
- Python: MySQL Create Table
- Python MySQL - Update Query
- How to install MySQL connector package in Python?
- Create MySQL Database Login Page in Python using Tkinter
- SymPy | Permutation.order() in Python
- Python - Custom order dictionary
- Python - Order Tuples by List
- Higher Order Functions in Python
- Python | Shuffle two lists with same order
- Python | Get items in sorted order from given dictionary
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.