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

From: Alexandr Savinov <savinov_at_host.com>
Date: Tue, 07 Jun 2005 17:42:23 +0200
Message-ID: <42a5c072$1_at_news.fhg.de>


Jon Heggland schrieb:
> In article <42a5b411$0$8714$ed2619ec_at_ptn-nntp-reader02.plus.net>,
> paul_at_test.com says...
>

>>>Not exactly: SQL ignores NULLs in aggregate functions (except COUNT(*)). 
>>>It is not treated as zero for AVG, for instance. Also note that x + NULL 
>>>evaluates to NULL; therefore, SQL's SUM is not iterated addition -- it 
>>>has a much more complicated definition.
>>
>>I'd suggest that SQL's SUM *should* be iterated addition.

>
>
> I agree. Which would also mean that the empty sum is 0, not NULL. Date
> has written quite a lot on this.
>
>
>>And that all
>>aggregates should return NULL if any of the attributes in the aggregated
>>column are NULL. Surely if any of them are unknown, we must say that the
>>sum or average is unknown also?

>
>
> Yes, if NULL means unknown.

To say "if NULL means unknown" is the same as to say "if 0 is equal 1" or "if empty set is full set". Unknown and null are two different things and deserve to have to special designations.

NULL means absence
UNKNOWN means presence with unknown identity

Everything else has a custom semantics defined and maintained by the user.

-- 
alex
http://conceptoriented.com
Received on Tue Jun 07 2005 - 17:42:23 CEST

Original text of this message