Machine-translated by Google. Questions are authored in English.
Top

Discussion

The EXISTS keyword will be true if:

  • A.any row in the subquery meets the condition only.
  • B.all rows in the subquery fail the condition only.
  • C.both of these two conditions are met.
  • D.neither of these two conditions is met.

Answer: A

Correct answer: any row in the subquery meets the condition only.

EXISTS is a test of emptiness: it returns true as soon as the subquery produces one row, and false only if the subquery produces none. Because it stops at the first match and never examines the values returned, it is usually more efficient than the equivalent IN or count, and it is written as SELECT * or SELECT 1 for exactly that reason.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.