Re: The BOOLEAN data type

From: andrewst <member14183_at_dbforums.com>
Date: Fri, 25 Apr 2003 12:07:22 +0000
Message-ID: <2806481.1051272442_at_dbforums.com>


Originally posted by Peter Koch Larsen
> With the risk of sounding very uneducated let me ask which
> axioms you are
> referring to. Also, I would like to ask why such axioms should hold
> considering we are not discussing boolean algebra but an extension
> to it. I
> would be happy if only all axioms would hold whenever no nulls were
> involved.
>
> > + T F N
> > T ? ? ?
> > F ? ? ?
> > N ? ? ?
> + T F N
> T T T T
> F T F N
> N T N F
>
> > * T F N
> > T ? ? ?
> > F ? ? ?
> > N ? ? ?
> * T F N
> T T F N
> F F F F
> N N F N
>
> ~ T F N
> F T N
> > T=True F=False N=Null(or whatever) +=OR *=AND
> ~= "NOT"
> Very naive, perhaps ;-)
>
> > Hint: The problem will be the existence of the inverse
> element...
> Give me a little more help, please.
>
> Kind regards
> Peter Koch Larsen
Things start to go wrong when you apply rules like:

(X or Y) is equivalent to !(!X and !Y) (e.g. "big OR ugly" is same as "not(small AND beautiful)")

because if X and Y are NULL then

(X or Y) = (NULL or NULL) = FALSE (from your OR table, SQL would say NULL) But (X or Y) is equivalent to !(!X and !Y), i.e. !(!NULL and !NULL)

  • !(NULL and NULL) (from your NOT table)
  • !NULL (from your AND table)
  • NULL (from your NOT table)

So now you have FALSE = (NULL or NULL) = NULL

And if NULL = FALSE then !NULL = TRUE, and so NULL is also TRUE (since !NULL = NULL)...

--
Posted via http://dbforums.com
Received on Fri Apr 25 2003 - 14:07:22 CEST

Original text of this message