Subqueries with IN
Subqueries work great with IN for matching multiple values.
Find employees in high-paying departments:
The subquery returns a list of department IDs, then IN checks each employee.
NOT IN finds employees NOT in those departments.
Check your understanding
Find employees in departments where average salary exceeds $80,000.
Examples run on the employees sample database. Open any of them in the playground to experiment.