Recall & Review
beginner
What does the
WHERE clause do in SQL?The
WHERE clause filters rows in a table to return only those that meet a specified condition.Click to reveal answer
beginner
How does the
AND operator work in a WHERE clause?The
AND operator combines two or more conditions and returns rows only if all conditions are true.Click to reveal answer
beginner
Write a simple SQL query using
WHERE with AND to find employees older than 30 and in the 'Sales' department.SELECT * FROM employees WHERE age > 30 AND department = 'Sales';
Click to reveal answer
intermediate
Can the
AND operator be used with more than two conditions in a WHERE clause?Yes, you can combine multiple conditions with
AND. All must be true for a row to be included.Click to reveal answer
beginner
What happens if one condition in a
WHERE clause with AND is false?The entire
WHERE condition is false, so the row is excluded from the results.Click to reveal answer
What does the
AND operator do in a SQL WHERE clause?✗ Incorrect
The
AND operator requires all conditions to be true for a row to be included.Which SQL query correctly uses
WHERE with AND to find products priced above 100 and in stock?✗ Incorrect
Only option A uses
AND to require both conditions: price above 100 and stock available.If a row meets the first condition but not the second in a
WHERE clause with AND, will it be included?✗ Incorrect
With
AND, all conditions must be true for the row to be included.Can you use more than two conditions combined with
AND in a WHERE clause?✗ Incorrect
SQL allows combining many conditions with
AND in a WHERE clause.What is the result of this query? <br>SELECT * FROM users WHERE age > 18 AND city = 'Paris';
✗ Incorrect
The query returns users who satisfy both conditions: age over 18 and city equals Paris.
Explain how the
WHERE clause with the AND operator filters data in SQL.Think about how you pick fruits that are both ripe and red.
You got /4 concepts.
Write an example SQL query using
WHERE with AND to find records matching two conditions.Try to find employees who work in 'HR' and have a salary above 50000.
You got /4 concepts.