Re: NULLs: theoretical problems?

From: Keith H Duggar <duggar_at_alum.mit.edu>
Date: Thu, 23 Aug 2007 21:03:43 -0700
Message-ID: <1187928223.152774.256440_at_z24g2000prh.googlegroups.com>


Jan Hidders wrote:
> V.J. Kumar wrote:
> > Jan Hidders wrote:
>
> > > I mean that if you take a select-from-where query with a formula f in
> > > in the where clause containing the DEF construct then replacing f with
> > > f' where all the DEF constructs are removed (i.e. we replace "DEF x :
> > > g" with "g" until there are no more such expressions) sometimes
> > > changes the meaning of the query.
>
> > Let's take a look at it. Could you give a query example and you
> > interpretration of the DEF construct therein ?| ?
>
> SELECT * FROM t WHERE DEF t.a : (t.a = 5 OR TRUE);
>
> is not equivalent with
>
> SELECT * FROM t WHERE t.a = 5 OR TRUE;
>
> I'm not sure why you want me to explain the meaning of the DEF
> construct again, because you already seemed to understand it, but for
> completeness: the formula "DEF c : f" holds iff the value of column c
> is defined and the formula f holds.

And previously you wrote:

> meaning of "DEF t.a : f(t.a)" would be that t.a is defined and the
> formula f(t.a) holds. It would be required for nullable attributes,
> but not for not nullable attributes. So if t.a is nullable, and s.b
> not, then you would have to write "DEFI t.a : t.a = s.b". The need for
> this can be relatively straightforwardly checked by the DBMS

So it's required to "write DEF" for all nullable attributes and a formula is true only if the nullable attributes are defined. How is this different from dropping the requirement to "write DEF" and simply defining that a formula is false if any of it's variables is undefined? And how is that different from allowing NULL and defining that a formula is false if any variable is NULL? If they differ can you provide an example? Thank you.

KHD Received on Fri Aug 24 2007 - 06:03:43 CEST

Original text of this message