Re: Implementation of boolean types.

From: Tony Andrews <andrewst_at_onetel.com>
Date: 15 Jul 2005 04:42:29 -0700
Message-ID: <1121427749.003504.48880_at_f14g2000cwb.googlegroups.com>


-CELKO- wrote:
> NULL is not a logical value and UNKNOWN is. Look up the truth tables
> in any SQL book.
>
> Q: Now what is the first and most important rule of NULLs?
> A: NULLs propagate in computations!
>
> That means we should have these rules for Boolean types:
>
> NULL AND TRUE = NULL
> NULL AND FALSE = NULL
> NULL AND NULL = NULL
>
> NULL OR TRUE = NULL
> NULL OR FALSE = NULL
> NULL OR NULL = NULL
>
> NOT NULL= NULL -- valid but really weird looking, unh?

That would be a dumb treatment, really. NULLs propagate in computations for numbers, because it makes sense to do so: we really don't know what 1+NULL is equal to. But we DO know that (FALSE AND [any boolean value]) = FALSE, so logically NULL should NOT propagate here.

Jonathan's post expresses my expectation of how NULLs should behave. Received on Fri Jul 15 2005 - 13:42:29 CEST

Original text of this message