SQL LEARNING PLATFORM
Combining multiple conditions into one filter.
Learning Blocks
Interactive Queries
Concepts you'll master
AND: both conditions must be true
OR: at least one condition must be true
NOT: invert a condition
Parentheses to control evaluation order
SELECT name, department, salary FROM employees WHERE department = 'IT' AND salary > 70000;
SELECT name, department FROM employees WHERE department = 'IT' OR department = 'HR';
Everyone except Salses
SELECT name, department FROM employees WHERE NOT department = 'Sales';
❌ Common Mistake: AND has higher precedence than OR, just like multiplication vs addition in maths. WHERE a OR b AND c is evaluated as WHERE a OR (b AND c), which is almost never what you intended. Always use parentheses
SELECT name, department, salary
FROM employees
WHERE department = 'Sales'
OR (department = 'IT' AND salary > 80000);Practice your SQL skills