Re: NULLs

From: TroyK <cs_troyk_at_juno.com>
Date: Thu, 3 Jan 2008 15:23:51 -0800 (PST)
Message-ID: <fbdf7d09-c495-4846-8b31-bd213bf1b397_at_p69g2000hsa.googlegroups.com>


On Jan 3, 3:55 pm, Hugo Kornelis
<h..._at_perFact.REMOVETHIS.info.INVALID> wrote:
> On Fri, 28 Dec 2007 17:59:13 -0800 (PST), David BL wrote:
>
> (snip)>In the presence of missing information the query
>
> >    "List all employees aged 40 and above"
>
> >cannot be answered at all.  Instead the query should be
>
> >    "List all employees known by the HR department to be aged 40 and
> >above"
>
> (snip)
>
> >In the case of the question
>
> >    "Is JJ older than Mary?"
>
> >This should be
>
> >    "Is it known to HR department that JJ is older than Mary?"
>
> >in which case the answer is no.   See, no 3VL required.
>
> >We can also ask whether it is known to HR department that JJ is not
> >older than Mary".   The answer is no as well; so we have been able to
> >tell (using only efficient 2VL) that the DB doesn't know who it older.
>
> Hi David,
>
> Happy new year to you and all else still readin gthis thread.
>
> You make some fair points. Thanks for that.
>
> In a purely pragmatic sense, are there any situations where this way of
> looking at things produces different results than the traditional SQL
> approach? It doesn't in the case of the examples above:
>
> * "List all employees known by the HR department to be aged 40 and
> above" will exclude employees with no age on file, just as "SELECT name
> FREM employees WHERE age > 40" will exclude employees with age NULL.
>

<snip>

>
> Best, Hugo

Was just discussing a similar example with colleagues today. Let's introduce a hypothetical business rule: all employees must be over 40 years old (with the age column still nullable).

What would you expect the result of the SELECT statement to return in that case?

TroyK Received on Fri Jan 04 2008 - 00:23:51 CET

Original text of this message