Instruction
Very nice. It's time to review what we've learned about NULLs so far:
- Rule number one: Never trust a
NULL. Keep your eyes open. - Use the operator
IS NULLto check if the column isNULL. - Use the operator
IS NOT NULLto check if the column isnot NULL. - The equality and non-equality conditions (
price = 7,price = NULL,price > 15) are never true when the argument isNULL. - Arithmetical operations (e.g.
a + b) and most functions (e.g.a || b,length(a)) will return aNULLif any of the values is aNULL. COALESCE(x, y, ...)returns the first non-NULL argument.NULLIF(x, y)returnsxwhenx != yorNULLwhenx = y.
Are you ready for a short quiz?
Exercise
Click to get some practice!



