?
What is the significance of "ORDER BY" in the following MySQL statement?
What is the significance of "ORDER BY" in the following MySQL statement?
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id;
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id;
Answer & Solution
Correct Answer:
Option
A
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.
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.
Join the Discussion
Login to post a comment or share your explanation.
Login