Unit 1, lesson 5 · AND, OR
Combining conditions with AND and OR
Two lists in one email
AND keeps a row only when both conditions are true. OR keeps a row when either condition is true. When a WHERE mixes the two, SQL evaluates AND first, so a OR b AND c means a OR (b AND c). Parentheses make the grouping you mean explicit.
SELECT name, price
FROM products
WHERE category = 'Lighting'
AND price < 60;Your task
The marketing team is sending one email with two groups of products: Audio products under $100, and any product over $300. List the name, category and price of every product in either group.
Tables you will use: products
Try it in your browserFree, no sign-up. Your query is checked as you go.