Re: Does Codd's view of a relational database differ from that ofDate& Darwin? [M.Gittens]

From: Alexandr Savinov <savinov_at_host.com>
Date: Mon, 06 Jun 2005 12:56:51 +0200
Message-ID: <42a42c05$1_at_news.fhg.de>


Paul schrieb:
> Alexandr Savinov wrote:
>

>>Nulls are equivalent of empty set (absence, hole etc.) and I can imagine
>>a model without any other elements but not without nulls. In other
>>words, null is what any model starts from and after that we can add any
>>other non-primitive elements we want to see :-) Those other elements may
>>pollute the model or may be argued to be unnecessary but not null
>>values. Since nulls play such a role they are actually not true
>>"values"( in the sense we use "normal" values, say, 5, 10 or "some text").

>
>
> I don't think the NULL or empty set of set theory is exactly the same as
> the NULL of relational database theory.
>
> After all, simple arithmetic is often built starting from the NULL set,
> with it playing the part of zero, which is a value.
>
> The "set" metaphor in RDBMS terms is more like table=set,
> row=member_of_set. So a set theory kind of NULL would more correspond to
> a table with no rows.
>
> And each row represents a logical proposition, and standard first order
> predicate logic is two-valued.
>
> Sure, everything can ultimately be based on set theory and the empty
> set, but it makes sense to use more advanced structures (like predicate
> logic) where necessary and forget about any fundamental construction.
>
> Also, there are different types of missing values, and these are
> specific to the domain, not universal, so it makes sense to have them
> modelled as part of a domain. Aggregate functions may want to deal with
> different types of NULLs in different ways (e.g. Unsalaried vs. Salary
> Unknown).

The situation with NULLs clearly demonstrates some serious problems of the relational model. I personally do not see any problem with NULLs but I am not thinking in terms of relational model. I've read this paper

http://www.hughdarwen.freeola.com/TheThirdManifesto.web/Missing-info-without-nulls.pdf

and I am really surprised - it provides completely unacceptable "solution" - it compomises the whole relational model IMO. NULL values have an absolutely concrete meaning and it does not matter how we call them after that. And this meaning, the things with such a semantics, is the basis of the model. This semantics can be expressed as "the absence" of thing. Any model starts from empty state before it can be populated with other kind of things and this initial state is strongly associated with the semantics of absence. If something disappears, if something is deleted then acutally we get null.

I absolutely understand that in practice we need different kinds of special values. But having custom special values with the semantics defined exclusively by the user is different from system special values with the built-in semantics. Semantics is determined by the consequences of having such values. If these consequences are defined by the user then the the model and the system do not care. But there is one fundamental value without which a model and a database cannot exist at all - it is NULL - and it has its semantics defined at the model and at the system level as absence.

The main problem is that people try to use NULL value in order to overload its meaning by some custom semantics. In relational model it is quite possible because in RM most of operational semantics is defined manually in SQL queries, i.e., RDBMS is unaware of its data meaning (it is the user who knows the semantics). In this case we may ourselves define the meaning of such special system level things as NULL value - it is a source of numerous problems and a defect of the model. The fundamental meaning cannot be overloaded because it is the system that interprets this value in order to maintain the database in the consistent state and derive meaningful consequences. In other words, we cannot provide our own interpetation of NULLs becuase the system and the model already interpret it in some special way. If we will use NULL arbitrarily then the database will have some unpredictable meaning. (Yet, again, in RM such a behaviour is not enforced becuase most things are done manually.) For example, if we delete a record then all rows in other tables that had it as a property must be nullified (in this property). And this bechaviour cannot be changed because it is the semantics of absence of things, which is what a good model starts from (along with other fundamental concepts like existence of things).

-- 
alex
http://conceptoriented.com
Received on Mon Jun 06 2005 - 12:56:51 CEST

Original text of this message