What is the purpose of the SQL 'ORDER BY' clause? MCQ with Answer and Explanation

What is the purpose of the SQL 'ORDER BY' clause?
A. To join tables
B. To filter rows
C. To group rows
D. To sort the result set
Answer: Option D
Solution (By JKExamLibrary)
ORDER BY sorts the query results in ascending or descending order based on specified columns.

This question belongs to: Computer Database Management System (DBMS)

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1 Report Error
Which SQL command is used to add new rows of data into an existing table?
A. ADD
B. APPEND
C. UPDATE
D. INSERT

Correct Answer: Option D


Explanation:
The INSERT command is a Data Manipulation Language (DML) statement used to add new records/rows to a table.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
Which property of a DBMS ensures that all operations within a transaction are completed successfully, or none of them are executed at all?
A. Consistency
B. Isolation
C. Durability
D. Atomicity

Correct Answer: Option D


Explanation:
Atomicity follows the 'all-or-nothing' rule, ensuring that a transaction is either fully committed or completely rolled back if an error occurs.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
Which clause is used in SQL queries to filter rows and retrieve only those records that satisfy a specific condition?
A. HAVING
B. ORDER BY
C. WHERE
D. GROUP BY

Correct Answer: Option C


Explanation:
The WHERE clause is used to filter records based on a specified condition before any grouping takes place.

This question belongs to: Computer Database Management System (DBMS)