Re: Does Codd's view of a relational database differ from that ofDate & Darwin? [M.Gittens]
Date: Fri, 10 Jun 2005 12:15:15 +0200
Message-ID: <42a96847$1_at_news.fhg.de>
Jon Heggland schrieb:
>>It is a variable that may have a type while NULL is a value that can
>>be assigned to any variable of any type including relvars.
> > > Values also have types. NULL is not a value. It is not equal to itself. > Or do you claim that it is?
Value is defined to be a singularity (delta-function where a single element is possible while all the rest from the domain are impossible). In this sense indeed NULL as complete impossibility (all elements are impossible) is not a value. Logically it is a contradiction.
However, in practice the situation is different. In RM we frequently have to do many things that do not make sense. And here I agree that in RM and in SQL NULL should be defined as not equal to itself. Else we will have even more problems then we already have.
If we distinguish two types of variables:
- single-valued, and
- set-valued
the the solution is to reserve NULL for single-valued variables and
empty set {} for set-valued variables. Then NULL and empty set can be
treated as one and the same thing but having different type. It is
obviously a convenience method - we introduce two separate entities
because we are not able to answer question what is their difference in
different situations. More interesting question is if it is possible to
solve the problem by having only one thing for both types of variables.
Do you think it is possible and necessary?
>>But it would be very interesting to know what fundamental reasons might
>>exist for separating NULL as a variable value and empty set as a
>>collection without elements. For example, do we really need to have
>>different meaning for:
>>1. some_relvar = NULL, and
>>2. some_relvar = {}
>>
>>How do you think? What is the fundamental difference between these two
>>lines of code and do we loose a lot if we retain only the first one
>>(with the meaning of the second)?
> > > #2 has a clearly defined meaning. What does #1 mean?
Here are the options for #1:
- is empty set (equivalent to #2) - is not assigned/initialized (one possible interpretation is UNKNOWN) - any possible set (UNKNOW) - is not needed and should not be used
What would you prefer?
-- alex http://conceptoriented.comReceived on Fri Jun 10 2005 - 12:15:15 CEST