Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
3. A quick review of NULLs
The COALESCE() function
The GREATEST() & LEAST() functions
The NULLIF() function
Summary

Instruction

Okay, now let's do a quick review of NULLs.

A NULL indicates that a value is unknown or missing. You might see a NULL in the last_name field of a client table if you don't have the client's last name (because you forgot to ask!). You may have a NULL in the launch_date field of a product table if that product hasn't been launched.

A NULL in a product_price field doesn't mean that the product is free, just that we don't know the price.

We use the operators IS NULL and IS NOT NULL to check if a value is NULL. IS NULL works like this:

SELECT *
FROM product
WHERE category IS NULL;

Exercise

Select name for all products whose launch_date isn't a NULL.