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

From: Roy Hann <specially_at_processed.almost.meat>
Date: Tue, 19 Sep 2006 07:59:37 +0100
Message-ID: <opidnVD6manyCJLYRVnyrQ_at_pipex.net>


"Chris Lim" <blackcap80_at_hotmail.com> wrote in message news:1158642255.069101.30980_at_h48g2000cwc.googlegroups.com...
> Marshall wrote:
>> In comp.lang.java.programmer, it was not uncommon to have
>> someone describe a problem that would trivially be solved
>> by adding a new class, but they would reject that solution because
>> "too many classes."
>
> The key difference here is 'trivially'. Adding lots (and we are talking
> about lots when you consider the number of nullable columns) of tables
> makes it much hard to query that data (especially if you also disallow
> outer joins!). And if you are going to prove me wrong with an example,
> at least use a table with lots of nullable columns instead of just one
> or two.

You are incorrectly assuming that each nullable column gives rise to a separate table. Based on the three or four dozen databases that I work with regularly that wouldn't usually happen. In most cases a table will have 5, 10, maybe more nullable columns because it conflates two or three different entity types. Thus just one or two additional tables are often sufficient.

But if more were required, so what? You've got to write the code to sort it out somewhere, so why not in the query?

Roy Received on Tue Sep 19 2006 - 08:59:37 CEST

Original text of this message