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

Instruction

Good. Finally, we'll refresh your knowledge of NULLs.

NULL indicates that a value is unknown or missing. You might see a NULL in a table with clients if you don't have the client's last name (because you forgot to ask!).

You could have a NULL in the LaunchDate field of a Product table if that product hasn't been launched yet.

A NULL in a product price field doesn't mean that the product is free; it simply means that we don't know the price.

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

SELECT
  *
FROM Product
WHERE Category IS NULL;

Exercise

Select all product names where the launch date is not NULL.

Stuck? Here's a hint!

Use a WHERE clause and IS NOT NULL.