nerdexam
CompTIA

LX0-104 · Question #550

Which of the following words is used to restrict the records that are returned from a SELECT query based on supplied criteria for the values in the records?

The correct answer is C. WHERE. In SQL, the WHERE clause is used with the SELECT statement to filter records, returning only those that satisfy a specified condition.

Shells, Scripting and Data Management

Question

Which of the following words is used to restrict the records that are returned from a SELECT query based on supplied criteria for the values in the records?

Options

  • ALIMIT
  • BFROM
  • CWHERE
  • DIF

How the community answered

(55 responses)
  • A
    5% (3)
  • B
    4% (2)
  • C
    89% (49)
  • D
    2% (1)

Why each option

In SQL, the `WHERE` clause is used with the `SELECT` statement to filter records, returning only those that satisfy a specified condition.

ALIMIT

`LIMIT` restricts the number of rows returned by the query, usually for pagination, but it does not filter based on criteria applied to column values.

BFROM

`FROM` specifies the table or tables from which to retrieve data; it defines the source of the data, not the filtering criteria.

CWHERECorrect

The `WHERE` clause is fundamental in SQL `SELECT` queries for applying conditions to rows, causing the database to return only the rows that match the criteria specified after `WHERE`. This directly restricts the result set based on values within the records.

DIF

`IF` is a conditional function or statement in some SQL dialects, but it is not the standard clause used to filter rows in a `SELECT` statement based on record values; `WHERE` is used for that purpose.

Concept tested: SQL SELECT query filtering

Source: https://learn.microsoft.com/en-us/sql/t-sql/queries/select-where-from-transact-sql?view=sql-server-ver16

Topics

#SQL#SELECT query#database queries

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice