Re: The BOOLEAN data type

From: Peter Koch Larsen <pkl_at_mailme.dk>
Date: 15 Apr 2003 16:53:35 -0700
Message-ID: <61c84197.0304151553.4b99401d_at_posting.google.com>


71062.1056_at_compuserve.com (--CELKO--) wrote in message news:<c0d87ec0.0304121533.3cd9aba7_at_posting.google.com>...
> >> The boolean type has been in the standard for a while, at least
> since SQL:1999. But it isn't a _core_ SQL:1999 requirement. <<
>
> To quote from SQL-99 COMPLETELY, REALLY by Gulutzan & Pelzer:
>
> "Warning: by saying that UNKNOWN and NULL are both to be used
> interchangably to mean the same thing, one is saying that "I don't
> know" and "I know the data is missing" are the same thing. The
> drafters of the SQL Standard apparently forgot the distinction, and
> they have ben justly critisized for this error."
>
> The foundations of SQL asserted that: (1) UNKNOWN and NULL are
> totally different values in totally domains (2) All datatypes can
> support NULLs (3) NULLs have predictable values, which include
> propagation. Look at the basic 3VL:
>
> TRUE OR UNKNOWN = TRUE
> TRUE OR NULL = NULL = UNKNOWN -- assuming propagation of null!!

Well.... SQL has many faults, one of them being the value of having a NULL datatype. While I tend to agree that nulls in basetables are of little or no value, I do see the NULL value as a reasonable way to support outer joins.

This terrible of treating null-values with propagation is just incoherent, however. Who ever invented that? While meaningful for e.g. arithmetic values (null + x is clearly null, and it seems reasonable to treat null*x = null even though this is incoherent if x = 0), this is just silly for booleans and possibly also for some userdefined datatypes. Why does SQL not use three-valued logic?

Kind regards
Peter Received on Wed Apr 16 2003 - 01:53:35 CEST

Original text of this message