Objective: Distinguish Missing Values
It’s inevitable that some data in your database has no value. Either you need to insert a row before you have discovered the values for all the columns, or else some columns have no meaningful value in some legitimate circumstances. SQL supports a special null value, corresponding to the NULL keyword.
There are many ways you can use a null value productively in SQL tables and queries:
-
You can use null in place of a value that is not available at the time the row is created, such as the date of termination for an employee who is still working.
-
A given column can use a null value when it has no applicable value on a given row, such as the fuel efficiency rating for a car that is fully electric.
-
A function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access