Question:

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
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation


Step 1: Understanding the Concept:

Filtering is the process of selecting specific rows from a table that meet a certain criteria, while hiding the rows that do not.

Step 2: Detailed Explanation:


ORDER BY: Used to sort the result set in ascending or descending order.
GROUP BY: Used to arrange identical data into groups, often used with aggregate functions.
WHERE: This is the primary clause used to filter records. It acts on individual rows before any grouping occurs. For example: SELECT FROM students WHERE age > 18;
HAVING: Also used for filtering, but it specifically filters groups created by the GROUP BY clause, not individual rows.

Step 3: Final Answer:

The WHERE clause is used to filter records.
Was this answer helpful?
0
0