MySQL SELECT Query Criteria and Record Filtering | Linux LFCS Exam

SELECT SQL Query Criteria for Record Filtering

Question

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?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C

The word used to restrict the records that are returned from a SELECT SQL query based on a supplied criteria for the values in the records is C. WHERE.

In a SQL query, the SELECT statement is used to retrieve data from one or more tables. The WHERE clause is used to filter the data returned by the SELECT statement. The WHERE clause specifies a condition that must be met for each record that is returned.

For example, if we have a table called "employees" with columns "id", "name", and "salary", we can use the following SQL query to retrieve the names of all employees who earn more than $50,000 per year:

sql
SELECT name FROM employees WHERE salary > 50000;

In this query, the WHERE clause specifies the condition "salary > 50000", which means that only records with a salary greater than $50,000 will be returned. The SELECT statement specifies that we want to retrieve the "name" column for each of these records.

To summarize, the WHERE clause 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.