LX0-104 · Question #89
Which of the following words is used to restrict the records that are returned from a SELECT SQL query based on a supplied criteria for the values in the records?
The correct answer is C. WHERE. The WHERE clause in an SQL SELECT statement is used to filter rows based on specified conditions. It restricts the records returned to only those that satisfy the criteria.
Question
Options
- ACASE
- BFROM
- CWHERE
- DIF
How the community answered
(51 responses)- A2% (1)
- B2% (1)
- C92% (47)
- D4% (2)
Why each option
The `WHERE` clause in an SQL `SELECT` statement is used to filter rows based on specified conditions. It restricts the records returned to only those that satisfy the criteria.
CASE is a conditional expression used for defining different outcomes based on conditions, not for filtering rows.
FROM specifies the table(s) from which to retrieve data, not for filtering records based on values.
The `WHERE` keyword in a `SELECT` SQL query is specifically designed to apply a filtering condition to the rows of a table. Only rows where the `WHERE` clause condition evaluates to true are included in the result set, thereby restricting the returned records based on specific criteria.
IF is a conditional function available in some SQL dialects, but WHERE is the standard clause for filtering rows in a SELECT statement.
Concept tested: SQL SELECT statement - filtering data
Source: https://learn.microsoft.com/en-us/sql/t-sql/queries/select-where-transact-sql
Topics
Community Discussion
No community discussion yet for this question.