Joe Celko's SQL for Smarties: Advanced SQL Programming, Third Edition

Chapter 6: NULLs: Missing Data in SQL

Overview

A discussion of how missing data should be handled 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 author on relational databases, advocates not using any general-purpose tokens for missing values at all. Standard SQL uses one token, based on Dr. Codd's original relational model.

Perhaps Dr. Codd was right again. In Standard SQL, adding ROLLUP and CUBE created a need for a function to test NULLs to see if they were in fact "real NULLs" (i.e., present in the data and therefore assumed to model a missing value) or "created NULLs" (i.e., created as place holders for summary rows in the result set).

In their book A Guide to Sybase and SQL Server, David McGoveran and C. J. Date said: "It is this writer's opinion than NULLs, at least as currently defined and implemented in SQL, are far more trouble than they are worth and should be avoided; they display very strange and inconsistent behavior and can be a rich source of error and confusion. (Please note that these comments and criticisms apply to any system that supports...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Database Tools Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.