Which SQL clause is used to filter records in a query?

Which SQL clause is used to filter records in a query?

a) SELECT
b) WHERE
c) ORDER BY
d) GROUP BY

Answer:

b) WHERE

Explanation:

The WHERE clause is used in SQL queries to filter records based on specific conditions. It limits the rows returned by the query to those that meet the specified condition.

The WHERE clause can be used with SELECT, UPDATE, DELETE, and other SQL statements to refine the operation to only the rows that match the condition.

For example, SELECT * FROM employees WHERE salary > 50000 would return all employees with a salary greater than 50,000.

Reference:

Database Management System MCQ (Multiple Choice Questions)

Scroll to Top