Multiple choice technology databases

How is IN different form EXISTS ?

  1. IN executes the inner query for each row affected by the outer query and EXISTS executes the inner query only once irrespective of the outer query

  2. IN executes the inner query only once irrespective of the outer query and EXISTS executes the inner query only once irrespective of the outer query

  3. IN executes the inner query only once irrespective of the outer query and EXISTS executes the outer query for each row affected by the outer query

  4. IN executes the inner query for each row affected by the outer query and EXISTS executes the outer query for each row affected by the outer query

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The IN operator evaluates the subquery once to get a list of values, whereas EXISTS evaluates the subquery for each row processed by the outer query to check for the existence of a match.