Re: 3 value logic. Why is SQL so special?

From: Evan Keel <evankeel_at_sbcglobal.net>
Date: Sun, 10 Sep 2006 23:37:26 GMT
Message-ID: <Wk1Ng.230$TV3.131_at_newssvr21.news.prodigy.com>


"Bob Badour" <bbadour_at_pei.sympatico.ca> wrote in message news:EJpMg.15039$9u.165112_at_ursa-nb00s0.nbnet.nb.ca...
> Evan Keel wrote:
>
> > "Karen Hill" <karen_hill22_at_yahoo.com> wrote in message
> > news:1157742315.903040.15430_at_b28g2000cwb.googlegroups.com...
> >
> >>X-No-Archive:yes
> >>
> >>I know that visual basic, lisp, python, c , c++ , perl, all have 2
> >>value logic. What makes SQL so special that it needs 3vl when all
> >>these langauges make do with 2vl?
> >>
> >>I read a book on SQL which was authored by Date before I knew of the
> >>whole Date controversy and when I was learning SQL. I was thoroughly
> >>confused when he went on a spiel about nulls. I echoed this sentiment
> >>at work and was chastized and told that Date is a kook. Yet I have
> >>some time later accepted nulls and work with them just fine. In the
> >>back of my mind though, coming from a C++ background I still feel that
> >>if c++ can make it on 2vl why not SQL?
> >>
> >>Why do nulls make us feel so strange?
> >
> > As you know, 3 valued logic is simple: true, false, don't know.
>
> Actually, I don't know that and neither does anyone else really. The
> 3-vl semantics in SQL are inconsistent. Sometimes null behaves like
> unknown and other times it behaves like inapplicable.
>
>
> The problem
> > with null is that it is often used as a default value which is almost
always
> > surely wrong.
>
> That's hardly the only or even the primary problem. Null--even when
> handled with the utmost care--breaks fundamental identities.
>
>
> Null does not mean N/A, or missing.
>
> Except that sometimes it does.
>
>
> That's why you can't do
> > arithmetic with it.
>
> What do you mean? x + null = null <-- that's arithmetic.
>
> Except that sometimes x + null = x due to the inconsistencies in SQL.
>
>
> Null is a semantic construct that started out correctly
> > and ended up in most RDMS implementations.
>
> Some of the best minds in database management would disagree that it
> ever started out correctly.
>
>
> FWIW, I try to create subtypes
> > where there are no nulls.
>
> That's nice. I simply don't allow null in any database I design.

I'm with you on this one.

Evan Received on Mon Sep 11 2006 - 01:37:26 CEST

Original text of this message