This guide is specifically for PostgreSQL syntax.
Intermediate-level SQL WHERE Clause practice exercises with solutions.
Exercise 1
Question: Find employees who are NOT in the Engineering or Marketing departments.
SELECT * FROM employees WHERE department NOT IN ('Engineering', 'Marketing');
NOT IN excludes specified values. This is cleaner than writing multiple AND conditions.
PostgreSQL-Specific Notes
This page covers PostgreSQL syntax. Other databases may have different syntax for similar operations.