Vidyalelo
MySQL · Q691

MySQL

Programming · MySQL · question 691

Q691

What is the significance of "ORDER BY" in the following MySQL statement? SELECT emp_id, fname, lname FROM person ORDER BY emp_id;

A.
Data of emp_id will be sorted
Answer
B.
Data of emp_id will be sorted in descending order
C.
Data of emp_id will be sorted in ascending order
D.
All of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
The "ORDER BY" clause in a MySQL statement is like telling the database to arrange the results in a specific order.
In this case, "ORDER BY emp_id" means the results will be sorted based on the values in the "emp_id" column.
By default, the sorting is done in ascending order, meaning the lowest values of "emp_id" will appear first.
So the answer is Option C: Data of emp_id will be sorted in ascending order.