Question:medium

Which clause is used to filter records in SQL?

Show Hint

A common interview question is the difference between ‘WHERE‘ and ‘HAVING‘. Just remember: WHERE filters the rows before they are grouped, and HAVING filters the results after they are grouped.
Updated On: May 30, 2026
  • ORDER BY
  • GROUP BY
  • WHERE
  • HAVING
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: Understanding the Concept:
Filtering is the process of selecting a subset of data from a table based on specific criteria.
Step 2: Detailed Explanation:
- ORDER BY: Used to sort the output (Ascending/Descending).
- GROUP BY: Used to group rows that have the same values into summary rows.
- WHERE: This clause is used to filter records before any grouping takes place. It specifies conditions that the columns must meet to be included in the result.
- HAVING: Used to filter groups (usually in conjunction with GROUP BY) based on aggregate values.
Step 3: Final Answer:
The primary clause for filtering basic records is WHERE.
Was this answer helpful?
0


Questions Asked in CUET (UG) exam