Chapter 14

NULLs—Missing Data in SQL

Abstract

NULLs are how we handle missing and unknown data. They can be in the original data or generated by functions in SQL. NULLs propagate in math and logic.

Keywords

NULL

Dr. E. F. Codd

Fact “real NULLs”

“Created NULLs”

Empty table

Logic

3VL

Łukasiewicz

COALESCE()

NULLIF()

INDICATOR in host language

FOREIGN KEY

discussion of how to handle missing data enters a sensitive area in relational database circles. Dr. E. F. Codd, creator of the relational model, favored two types of missing-value tokens in his book on the second version of the relational model, one for “unknown” (the eye color of a man wearing sunglasses) and one for “not applicable” (the eye color of an automobile). Chris Date, leading ...

Get Joe Celko's SQL for Smarties, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.