← Quiz: Subqueries and Views: all 10 questions
Quiz: Subqueries and Views · Question 3 of 10
Why can NOT IN (subquery) return no rows unexpectedly?
Why can NOT IN (subquery) return no rows unexpectedly?
- A.NOT IN is not valid SQL
- B.If the subquery returns a NULL, every NOT IN comparison becomes unknown
- C.Subqueries can't be used with NOT
- D.It only works with numbers
Answer & explanation
Correct answer: If the subquery returns a NULL, every NOT IN comparison becomes unknown
x NOT IN (1, NULL) is never true. NOT EXISTS avoids this.
Can you get the rest right without peeking?
Take the timed Quiz: Subqueries and Views quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →