Re: 3 value logic. Why is SQL so special?
Date: 19 Sep 2006 00:38:02 -0700
Message-ID: <1158651482.204488.296170_at_i42g2000cwa.googlegroups.com>
Roy Hann wrote:
> 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.
There is also a duplicate-checking process which identifies potential duplicates between customers, using several of the optional attributes (e.g. First Name, Middle Name, Last Name, Birth Date, as a unique identifier is not always available). The current queries are complicated enough (and NULLs are easily handled with ISNULLs). Increasing the number of tables just to avoid NULLs would be a nightmare in this scenario (unless outer joins were permitted, but then you'd end up dealing with NULLs anyway).
> 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?
I would weigh up the advantages of avoiding NULLs with the extra overhead incurred by creating the extra tables (in terms of complexity in querying the data). In some cases I do create extra tables, but I just find the thought of taking this approach to the extreme to avoid all NULLs to be a bit, well, extreme.
Chris Received on Tue Sep 19 2006 - 09:38:02 CEST