Programming · Flashcard

What does the condition WHERE price = NULL match?

  • ANothing, because the comparison evaluates to unknown
  • BEvery row whose price column has no value stored
  • CEvery row, because = NULL is always taken as true
  • DEvery row whose price is zero or has no value at all

Why this is the answer

Comparing anything to NULL yields unknown, and WHERE keeps only rows where the condition is true — so = NULL silently matches nothing rather than erroring, which is what makes it a hard bug to spot. IS NULL is the test that works.

Official docs
Study in Gnoseed →