🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.NOT IN is not valid SQL
  2. B.If the subquery returns a NULL, every NOT IN comparison becomes unknown
  3. C.Subqueries can't be used with NOT
  4. 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 →