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

Discussion

If you are going to use a combination of three or more AND and OR conditions, it is often easier to use the IN and NOT IN operators.

  • A.
    True
  • B.False

Answer: A

Correct answer: True

A chain of OR conditions on one column collapses into a single IN: state = 'VA' OR state = 'MD' OR state = 'DC' becomes state IN ('VA','MD','DC'), and its negation becomes NOT IN.

The gain is not only brevity. Long AND and OR chains require careful parenthesising, since AND binds more tightly than OR and a missing bracket changes the meaning without any error. IN removes that hazard by expressing the whole set at once.

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

Post your comment

Please log in or register to post a comment.