What does the following query return? SELECT * FROM employees WHERE department_id = ANY (SELECT id FROM departments WHERE budget > 500000)

SQL Fundamentals Hard

SQL Fundamentals — Hard

What does the following query return? SELECT * FROM employees WHERE department_id = ANY (SELECT id FROM departments WHERE budget > 500000)

Key points

  • The query filters employees based on the budget of their respective departments
  • The ANY operator allows for comparison with multiple values
  • The subquery retrieves department IDs with budgets over 500000

Ready to go further?

Related questions