This guide is specifically for SQL Server 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.
SQL Server-Specific Notes
This page covers SQL Server syntax. Other databases may have different syntax for similar operations.