Re: NULLs: theoretical problems?

From: David Cressey <>
Date: Sat, 18 Aug 2007 15:57:17 GMT
Message-ID: <xFExi.1573$6h3.886_at_trndny05>

"Bob Badour" <> wrote in message news:46c6ddd4$0$4031$
> David Cressey wrote:

> Tautologies (and contradictions) arise often when evaluating queries
> against views.

I don't understand this (although maybe I should). Could you give one or two examples?

> > In situations where I've observed other programmers having trouble with
> > 3-valued logic, it nearly always boils down to using possibly omitted
> > values in a WHERE clause.
> Don't you mean subordinate clauses in the WHERE clause? Like "or x is
> null" ?

I certainly don't mean "or x is null". Whenever I've seen this in the SQL written by colleagues it has turned out to be a case of misbegotten database design or misbegotten query design, or possibly misbegotten query requisites. Whenever I've seen the the dreaded "or x is null", it means that the query author is seeking to retrieve two or more different propositions in the same operation. That's the underlying source of the problem and the confusion with SQL in this regard. Or maybe I mean "predicates", I'm not sure.

Correction to the above: It can also mean that the data base designer used the dreaded null to convey a message other than "no value here". In that case, the query author is the victim rather than the perpetrator.

Perhaps you know a query language where propositions (or maybe predicates) are expressed as such rather than cast into the expressions of operations on tables. If so, I'd venture to guess that the clumsiness of the attempt to retrieve two different kinds of facts in a single operation would stand out starkly in such a language.

> I respectfully suggest it is pointless to argue that NULL is easy to use
> after Date and Darwen have written several books worth of material
> explaining all of the subtle gotchas. See the various _Writings...._

You may be right about it being pointless to argue. I am going to continue to assert that, for at least one practitioner, they have been easy to manage compared to most of the other gotchas that have come down the pike in the last forty years of computing.

I don't even know the list of all the gotchas that you reference. At this point, the only reason I would bother to learn the list is to win arguments. And I've already conceded that that's probably a lost cause. Received on Sat Aug 18 2007 - 17:57:17 CEST

Original text of this message