Recall & Review
beginner
What is the purpose of the
WHERE clause in SQL?The
WHERE clause is used to filter records and return only those rows that meet a specified condition.Click to reveal answer
beginner
How do you filter rows where the column
age is greater than 30?Use
WHERE age > 30 to select rows where the age value is more than 30.Click to reveal answer
intermediate
Can the
WHERE clause use multiple conditions? How?Yes, by combining conditions with
AND or OR. For example, WHERE age > 30 AND city = 'Paris'.Click to reveal answer
beginner
What happens if you omit the
WHERE clause in a SELECT statement?All rows from the table are returned because no filtering condition is applied.
Click to reveal answer
intermediate
How do you filter rows where a column
name starts with the letter 'A'?Use the
LIKE operator with a wildcard: WHERE name LIKE 'A%'.Click to reveal answer
Which SQL clause is used to filter rows based on a condition?
✗ Incorrect
The WHERE clause filters rows to return only those that meet the condition.
What does this SQL do?
SELECT * FROM users WHERE age < 18;✗ Incorrect
The condition
age < 18 filters users younger than 18.How do you combine two conditions in a WHERE clause to require both to be true?
✗ Incorrect
AND requires both conditions to be true for a row to be selected.
Which operator is used to match patterns in a WHERE clause?
✗ Incorrect
LIKE is used for pattern matching with wildcards like % and _.
What will happen if you run
SELECT * FROM products; without a WHERE clause?✗ Incorrect
Without WHERE, all rows in the table are returned.
Explain how the WHERE clause filters data in a SQL query.
Think about how you pick only certain items from a list based on a rule.
You got /4 concepts.
Describe how to use multiple conditions in a WHERE clause and what logical operators you can use.
Consider how you decide if you want to buy something only if it is cheap AND new.
You got /4 concepts.