Re: Null in subquery returns no records

From: Dawn M. Wolthuis <dwolt_at_tincat-group.com>
Date: Mon, 9 Feb 2004 23:51:34 -0600
Message-ID: <c09rhg$3rt$1_at_news.netins.net>


"Jerome H. Gitomer" <jgitomer_at_erols.com> wrote in message news:4028632d$0$3209$61fed72c_at_news.rcn.com...
> Dawn M. Wolthuis wrote:
> > If NULL is considered to an "un" value then at least a three-valued
logic
> > must be employed to handle the fact that a NULL value is not equal to a
NULL
> > value, right?
> >
>
> The concept of NULL values and equality is foreign to RDBMS.
> Variables are not equal or unequal to NULL. SQL syntax does not
> allow:

Yes, you are right -- I work with models that include NULL as a value -- I noted at the start of the sentence that NULL (in an rdbms) is not a value, which is what accounts for the "three-valued" logic. I should have said that in this case, when a variable has no value, i.e. the unvalue of NULL, then its value is not the same as another variable which has no value, i.e. the unvalue of NULL. This is in contrast to the much more intuitive approach of thinking of NULL as a value that is equal to a NULL value and not accepting any variable has having no value. A two-valued logic (true/false) is so much easier to contend with..

>
> WHERE variable = NULL
>
> It does allow:
>
> WHERE variable IS NULL
>
> It may seem like a nit picking technicality, but then computer
> languages are based on nit picking technicalities.
>
> > A null set as the value of a variable is a value equal to another null
set
> > value.
> >
> Since we are talking about RDBMS and not pure math please define
> what you consider to be a set using relational terminology. The
> only entity that Codd defined that contains more than one
> value is the table. Tables cannot be NULL. Once they have been
> defined their structure exists and therefore they cannot be NULL.

I'm not talking about a relational database, so it is quite possible that there is no relational terminology for the concept of a domain that consists of sets. I guess you could consider it a user-defined type (?) in relational terminology.

> > The relational model itself does not require a three-valued logic and
you
> > can find Date and others argue in favor of a two-valued logic instead.
>
> There are some who argue that we should have three different
> types of unknown instead of just one. So what?

Yes, some argue that. The "so what" part is that database implementations that include a two-valued logic just might be better suited to use by human beings -- just an opinion based on observation and intuition, without any emperical data to back it up (yet).

>
> > There are numerous databases the employ the much more intuitive
two-valued
> > logic but I know of no implementations of the relational model that do.
> >
>
> If they did they would deviate from Codd's definition.

Yes, I think you are correct on that, but there are deviations in all implementations. Additionally, Codd had some good insights, but he was not handed two tablets of rules from above and there is room for mprovement. --dawn

>
> [ snip ]
> Jerry
>
Received on Tue Feb 10 2004 - 06:51:34 CET

Original text of this message