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

From: Alexandr Savinov <spam_at_conceptoriented.com>
Date: Thu, 17 Nov 2005 13:30:21 +0100
Message-ID: <437c77ee$1_at_news.fhg.de>


JOG schrieb:
> I think nulls may have been done to death in the literature. Date,
> Darwen and Pascal have written reams on the matter (and convincingly so
> - I don't think anyone would argue they are theoretically correct, just

Yes. But the fact that this question arises again and again is an indication that something somewhere is wrong.

> whether practically it matters). The problems all arise from english,

I think that one cause of the problem is that:

- it is solved in theory in one way,
- it is implemented in databases in another way,
- these databases are used in the third way,
- the problem domain needs some fourth solution

and all these aspects are frequently mixed in discussions.

> and how we formulate sentences. Consider:
>
> A) The dog's colour is black
> B) The dog's colour is unknown
>
> These look simliar in structure, but that's purely because of how we
> verbalise them. In terms of logic they are completely disparate
> statements and translate to:
>
> A) DOG has_colour BLACK
> B) DOG has_unknown_property COLOUR
>
> Clearly there is no room for a null, or unknown element here, and

Yes, for the DOG object there is no room for null. But what if some other object we need to add is known in advance to have no colour at all? A formal criteria for "does not have a colour" is that we do not want to see it when we select objects along dimension COLOUR.

Theoretically, we might define such a structure of tables that this situation is excluded. Practially, it is almost impossible so we need to   permit null value as an indication that some column is inappropriate for this object (and this object will be invisible from the side of this column).

> stated formally the two sentences look very different. Nonetheless
> these are two very differently structured _facts_ about the world, that
> just should be encoded in the db correctly.

The first statement can be definitely qualified as a fact. The second one is hardly a fact because it has a great degree of uncertainty. Actually, it says that DOG has one colour which is however not known. It can be black or even red but it is always one, and the current state of the database does not allow us to get it (if it is not a deductive database where we might infer it from other facts and rules).

One problem with facts is that we normally make positive statements about existence (at least in database world). But null values are negative character. If something is null then this property for this object is inappropriate, non-existent etc. It is difficult to operate such information in traditional fact-oriented or formal logic oriented frameworks (although possible).

-- 
http://conceptoriented.com
Received on Thu Nov 17 2005 - 13:30:21 CET

Original text of this message