Re: So what's null then if it's not nothing?

From: Jon Heggland <heggland_at_idi.ntnu.no>
Date: Fri, 9 Dec 2005 23:54:33 +0100
Message-ID: <MPG.1e042990d2a1555798973c_at_news.ntnu.no>


In article <mjvjp1p04cks0cimjmep5uvh8g9ek4p45n_at_4ax.com>, hugo_at_pe_NO_rFact.in_SPAM_fo says...
> On Fri, 9 Dec 2005 12:08:52 +0100, Jon Heggland wrote:
> >I really didn't know that truth valued attributes were so abhorred,
> >though. Interesting.
>
> I wouldn't call them "abhorred". But AFAIK, there's no way to
> incorporate "truth value" columns in a SQL database without breaking
> some of the foundations of SQL.

Heh. That does say something about SQL. :)

> We'll first have to agree on what the foundations are. To me, the
> following rules are part of SQL's foundation:
> [8<]
> 3. Each predicate evaluates to one of the three values defined in 3VL
> and each operation with 3VL valued operands results in a 3VL valued
> result according to the 3VL logic tables.

This one seems to be the problem. You'd need to postulate that any expression can be NULL, regardless of its type. Which I think is reasonable anyway---why make an exception for truth value expressions?

> This proves that the suggestion to treat UNKNOWN and NULL
> in a truth valued domain as being equal is not possible. (Yes, I have
> seen people make that suggestion - I don't believe it was in this group,
> though).

I thought, based on a Date article, that this actually was the SQL standard (except that FALSE AND NULL/UNKNOWN is FALSE, thus breaking your foundation #1). But maybe I misread (or misremember) him; maybe he was wrong; maybe he was talking about a proposed standard that never came to be.

> But if we have to define seperate results for FALSE AND TRUE, FALSE AND
> UNKNOWN, FALSE AND FALSE, and FALSE AND NULL, then we are clearly no
> longer dealing with the original 3VL logic tables that are mentioned in
> rule 3 above. Rather, we are extending them.

Isn't it possible to say we are dealing with the normal 3VL tables (without NULL), but that they only apply when there are no NULLs? After all, NULL is not a value. Smells bad, perhaps, but I don't really see the difference compared to how other domains deals with NULL.

> While this might theoratically and technically work, I don't like the
> idea. There are already too many people flabbergasted by 3VL - what
> would "4VL" do for them?

No need to call it 4VL. NULL is not a value. How NULL "works" is easy to remember; it destroys everything it touches (I.e. all expressions involving NULL evaluate to NULL (exceptions excepted)). For the rest, you have the normal 3VL truth tables.

> For me, it's just too many problems for too little gain.

Fair enough.

-- 
Jon
Received on Fri Dec 09 2005 - 23:54:33 CET

Original text of this message