Re: Two-valued logic

From: Joe \ <joe_at_bftsi0.UUCP>
Date: Tue, 6 Jan 2004 18:21:30 -0800
Message-ID: <1073442119.187567_at_news-1.nethere.net>


"--CELKO--" <joe.celko_at_northface.edu> wrote in message <news:a264e7ea.0401051727.71254790_at_posting.google.com>...

> >> ... And all kinds of ways of dealing with "missing data". Should
> the relational model bake in support for all of them, or if not, then
> which ones, exactly? <<
>
> You ought to be able to do something for missing data; it is a fact of
> life. Date's tricks for avoiding it just don't work. He had a
> soluton to an old SQL puzzle of mine on www.dbdebunk.com where we
> wanted the current salary date and the previous salary, but a new-hire
> (i.e. no previous data) ws to show up as a NULL. He used an actual
> date for a missing date (1900-01-01 or something); this implied that
> there was a loooooong time between raises for some personnel.

Where can I find the original text of the puzzle? I knocked together a few possible solutions in Access SQL (yeah, yeah) which hork up 'N/A' for any missing dates or salary amounts, both with and without resorting to IIf() or other functions.

> Well, the solution we came up in SQL with is the NULL. The advantage
> is that it has known characteristics, is pretty minimal and has
> built-in support. The dis-advantage is that missing data depends on
> the datatype -- those IEEE floating point thingies you just mentioned
> for numerics, versus strings, versus temporal data (+/- eternity,
> etc.)

However, NULL is one of the biggest headaches for just about everyone who actually works with SQL databases. Sometimes NULL appears to be equal to NULL, and sometimes it doesn't! Won't slaying the NULL beast require user-defined domains, supporting user-defined "special values" such as 'N/A' with user-defined semantics on a domain-by-domain basis, calling for user-defined comparison operators, etc., etc., etc.?

--
Joe Foster <mailto:jlfoster%40znet.com>  Sign the Check! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
Received on Wed Jan 07 2004 - 03:21:30 CET

Original text of this message