Re: 3 value logic. Why is SQL so special?

From: Chris Lim <blackcap80_at_hotmail.com>
Date: 16 Sep 2006 12:58:32 -0700
Message-ID: <1158436712.806291.66560_at_m73g2000cwd.googlegroups.com>


Cimode wrote:
> I know what you are getting at. But you are using the wrong example
> and asking the wrong question. The impact of using NULL values have
> nothing to do with presentation issues. You don't design data schemas
> according to the way data should look on user's screen but according to

Okay bad example. I wasn't really thinking about returning the data to the end-user, but from a programmer's view if I had to perform some calculations on data where I wanted flights with and without an actual departure date (and the calculation uses actual departure date if it's present and scheduled departure date if not). Without doing an outer join I can't see any way of doing this without having two queries or a UNION, which effectively doubles the amount of code to be written.

Another example. Say you needed to identify all flights that had the same scheduled_departure_date and actual_departure_date as another flight (including flights with no actual_departure_date). If actual_departure_date is in a separate table, then wouldn't you need two queries (or a UNION) to do the same thing you would in a single query if you allowed NULLs?

> SQL's way (a poor way) of dealing with missing data. For explanations
> on how to deal with missing data while preserving a normalized schema,
> you may want to take a look at McGoveran paper on the thirdmanifesto
> website...

Thanks, I'll check that out.

Cheers,
Chris Received on Sat Sep 16 2006 - 21:58:32 CEST

Original text of this message