Skip to content
Question 82 of 95

Q.Fill in the blank: .............. clause is used with SELECT statement to display data in a sorted form with respect to a specified column.

(a) WHERE
(b) ORDER BY
(c) HAVING
(d) DISTINCT
Yanam CbseCBSE Class XII Board 2023MCQ· 1mImportance★★★★★
86% · 82/95 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

The ORDER BY clause sorts query results by one or more columns in ascending or descending order.

When you retrieve data from a database table using a SELECT statement, the rows typically appear in no particular order—often the sequence in which they were inserted, though even that isn't guaranteed. If you want your results organized meaningfully, you need a way to impose order on the output.

The ORDER BY clause exists precisely for this purpose. It tells the database management system to arrange the result set according to the values in one or more specified columns. By default, ORDER BY sorts in ascending order (smallest to largest for numbers, A to Z for text), but you can explicitly request descending order using the DESC keyword.

Consider a simple example: if you have a student table with columns for name, age, and marks, writing SELECT * FROM students ORDER BY marks would display all students sorted from lowest to highest marks. Adding ORDER BY marks DESC would reverse that, showing top scorers first.

Let's quickly examine why the other options don't fit:

  • WHERE filters rows before they're selected, keeping only those that meet a condition (like WHERE age > 15)
  • HAVING filters groups after aggregation, used with GROUP BY to filter summarized data …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.