Nice. Let's explain the behavior of
NULL in detail. It's very important to understand it well as it is the source of frequent mistakes when writing SQL queries.
Let's talk about
NULL and equality. The condition:
price = 5.99
is not met when the value for price is
NULL. Well, that's quite obvious,
NULL doesn't equal 5.99 after all.
NULL never satisfies the equality condition. It may seem less obvious that the condition
price = NULL
is NEVER true, even if the price is a
NULL indeed. Keep in mind that you need to use
IS NULL or
IS NOT NULL instead of the equality sign.