In Defense of Nulls


Multiple Types of Nulls and Multi-Valued Logic

The current relational model defined by E. F. Codd (2) recommends two types of nulls should be used (nulls are called marks by Codd), An A-Mark is used when the column has a value which is not currently known. For example, a BirthYear column when the year of birth is not currently known for an individual (but the information may be obtained at a later time) would use an A-Mark. An I-Mark is used when the column can never have a valid value. For example, a NumberOfPregnancies column for a male person would use an I-Mark.

FirstSQL is the only RDBMS with full support for two types of nulls. In FirstSQL, SQL syntax is extended in an evolutionary manner. NULL as an assignable value is synonymous with A_MARK. The IS NULL clause is equivalent to IS MISSING (which allows either type of null). Explicit tests are also possible - IS A_MARKED or IS UNKNOWN and IS I_MARKED or IS INVALID.

With two types of nulls comes the possibility of a 4-valued logic system using TRUE, FALSE, UNKNOWN and INAPPLICABLE. In fact, n-valued logic systems are possible using any value for n from 2 up to infinity (1-valued logic systems are illogical), thus the term - Multi-Valued Logic. It is also possible to have more than 2 types of nulls, including user defined null types, covering any contingency.

The relational model restricts its processing to 2 types of nulls and to the use of 3-valued logic. In the relational 3-valued system, UNKNOWN is used for both A-Marks and I-Marks. This is a reasonable compromise between complexity and power. These facilities provide acceptable simplicity without unduly sacrificing expressive power.

The final section is Conclusion and References.

Return to Contents Page: In Defense of Nulls     Return to Issues Page


Copyright © 1998 FFE Software, Inc. All Rights Reserved WorldWide