Null Values
Field values in a tuple are sometimes unknown (e.g., a rating has not been assigned) or inapplicable (e.g., no spouse’s name).
- SQL provides a special value null for such situations.
The presence of null complicates many issues. E.g.:
- Special operators needed to check if value is/is not null.
- Is ratingɴ true or false when rating is equal to null? What about AND, OR and NOT connectives?
- We need a 3-valued logic (true, false and unknown).
- Meaning of constructs must be defined carefully. (e.g., WHERE clause eliminates rows that don’t evaluate to true.)
- New operators (in particular, outer joins) possible/needed.