Which SQL clause is used to specify the condition while fetching data from a single table or by joining multiple tables?
The Correct Answer is: C. WHERE
The WHERE clause in SQL is used to specify conditions that filter which rows are returned when fetching data from one or more tables. It restricts the result set to only those rows that meet the specified condition(s). Whether you are querying a single table or joining multiple tables, the WHERE clause helps you control which records appear in the final output by applying logical conditions.
Why the other options are incorrect:
A. SELECT
This clause specifies the columns or expressions to be retrieved but does not filter rows.
B. FROM
The FROM clause identifies the table or tables from which to retrieve data. It does not apply any filtering conditions.
D. ORDER BY
This clause sorts the resulting data by one or more columns, either ascending or descending. It does not filter rows based on conditions.
Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.
You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams