How do you set several filter conditions at once?
Several filter conditions are set using logical operators:
AND, every condition must be true at once;OR, at least one condition needs to be true;NOT, negates a condition.
Examples:
sql
-- 1. Every condition at once
WHERE age > 18 AND city = 'Kyiv'
-- 2. At least one condition
WHERE city = 'Kyiv' OR city = 'Lviv'
-- 3. Negation
WHERE NOT city = 'Kyiv'
-- 4. A combination with priority
WHERE (city = 'Kyiv' OR city = 'Lviv') AND age >= 25Parentheses are used to set the order the conditions are evaluated in.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.