Revision
3. NULL – quick revision
Comparisons with NULL
Functions with NULL
COALESCE to the rescue
NULLIF
Revision and practice

Instruction

Good. Let's get started and refresh your memory about NULLs first.

A NULL means that the value in question is unknown or missing. In a client table, you could have a NULL last name because you forgot to ask your client about it.

In your product table, you could have a NULL product launch date if it hasn't been introduced yet. A NULL product price doesn't mean that the product is free, it simply means that the price is unknown.

We use the operators IS NULL or IS NOT NULL to check, respectively, if the value is missing or not, just like this:

SELECT *
FROM product
WHERE category IS NULL

Exercise

Select name for all products whose launch_date is not a null.

Stuck? Here's a hint!

Introduce a WHERE clause and use IS NOT NULL.

Console

Code editor

Result

TableConsole