Filtering with WHERE Clause Flashcards
7 cards from real SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Filtering with WHERE Clause flashcards as text
Which query finds products priced 100 or less OR with quantity above 50?
Answer: WHERE price 50
OR returns rows satisfying at least one of the two conditions exactly as written.
What is the result of WHERE quantity NOT IN (1, 2, 3)?
Answer: Rows where quantity is none of 1, 2, or 3
NOT IN excludes rows matching any value in the list.
Which condition matches strings containing 'sql' anywhere in the column?
Answer: LIKE '%sql%'
Percent signs on both sides match the substring anywhere within the value.
How do you select rows where a column does have a value (not null)?
Answer: WHERE column IS NOT NULL
IS NOT NULL is the correct syntax to test for a present value.
Given WHERE a = 1 OR b = 2 AND c = 3, which is evaluated first?
Answer: b = 2 AND c = 3
AND has higher precedence than OR, so the AND pair is evaluated first.
Which query filters dates in the year 2025 using a range?
Answer: WHERE order_date BETWEEN '2025-01-01' AND '2025-12-31'
BETWEEN with start and end dates filters an inclusive date range.
What does the ESCAPE clause do in a LIKE expression?
Answer: Lets you treat wildcard characters as literals
ESCAPE defines a character so wildcards like % or _ can be matched literally.