QuizzesIN vs EXISTS vs ANY vs ALL — Concept Check
intermediate
sql

IN vs EXISTS vs ANY vs ALL — Concept Check

Questions on IN vs EXISTS vs ANY vs ALL. IN, EXISTS, ANY, and ALL are subquery operators with distinct NULL semantics, short-circuit behaviour, and performance profiles that determine correctness and speed.

7 minutes 7 questions Pass at 70%
Time Limit
7 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

7 questions on IN vs EXISTS vs ANY vs ALL — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A query using NOT IN returns zero rows unexpectedly. What is the likely cause?

    • AThe subquery contains NULL values.
    • BThe database is locked.
    • CThe main query has a syntax error.
    • DThe subquery returns no rows.
  2. 2.You want to find employees earning more than at least one employee in department 2. Which operator should you use?

    • AEXISTS
    • BIN
    • CALL
    • DANY
  3. 3.A developer uses NOT EXISTS to filter results. Why might this be preferred over NOT IN?

    • ANOT EXISTS is easier to write.
    • BNOT EXISTS always returns more rows.
    • CNOT EXISTS is faster in all cases.
    • DNOT EXISTS handles NULLs safely.
  4. 4.Which operator would you use to ensure a value is greater than every result in a subquery?

    • AANY
    • BIN
    • CALL
    • DEXISTS
  5. 5.A query using salary > ALL (subquery) returns no rows. What might be the issue?

    • AThe subquery returns only NULLs.
    • BThe comparison operator is incorrect.
    • CThe subquery returns no rows.
    • DThe main query has a syntax error.
  6. 6.Which operator is equivalent to using = ANY?

    • ANOT IN
    • BIN
    • CALL
    • DEXISTS
  7. 7.Which operator short-circuits upon finding the first match in a subquery?

    • AIN
    • BEXISTS
    • CANY
    • DALL