SQL WHERE Practice
WHERE clauses make SQL useful by filtering rows to the data you actually need. Practice common filters with short query exercises.
Example practice questions
Try these samples, then continue into the SQL Practice Labfor guided browser-based practice.
Return users where country is 'Canada'.
Answer: SELECT * FROM users WHERE country = 'Canada';
Return products where price is greater than 100.
Answer: SELECT * FROM products WHERE price > 100;
Return orders where status is not 'cancelled'.
Answer: SELECT * FROM orders WHERE status <> 'cancelled';
Return customers where email is missing.
Answer: SELECT * FROM customers WHERE email IS NULL;
Return products where category is 'Books' and price is under 20.
Answer: SELECT * FROM products WHERE category = 'Books' AND price < 20;
Return users created on or after 2026-01-01.
Answer: SELECT * FROM users WHERE created_at >= '2026-01-01';
Return products where name starts with 'Pro'.
Answer: SELECT * FROM products WHERE name LIKE 'Pro%';