Re: NULLs
Date: Fri, 28 Dec 2007 23:59:50 +0100
Message-ID: <g2van3h12ilt0m8s0q1hv47sceei7e386r_at_4ax.com>
On Thu, 27 Dec 2007 16:41:51 -0800 (PST), JOG wrote:
>On Dec 27, 11:31 pm, Hugo Kornelis
Hi J,
That would be the case if I were intentionally storing the fact that an
><h..._at_perFact.REMOVETHIS.info.INVALID> wrote:
>> On Wed, 26 Dec 2007 23:17:52 -0400, Bob Badour wrote:
>> > Codd pointed out that a single NULL marker did not suffice and
>> >suggested 2 markers. Date pointed out that one can apply the same
>> >argument to 2 markers leading to an infinite progression once one heads
>> >down that path, which suggests the path was never a productive one to
>> >head down in the first place.
>>
>> Hi Bob,
>>
>> Unfortunately, both Codd and Date forgot that the NULL marker in (for
>> instance) the age column should represent only that the age is not on
>> file and not try to represent a reason for this as well.
>>
>> Codd's suggestions to use two markers (for "not applicable" and
>> "unknown", IIRC) assumes that we want to store both the age of a person
>> (if on file), and the reason why an age is not on file (if it isn't).
>> That can of course be necessary - but in that case, we have two
>> attributes that should be stored in two seperate columns.
>>
>> Attempting to store both the age and the reason why an age is unknown in
>> a single column violates first normal form.
>
>Is the Zaniolo approach you are favouring not doing exactly the same
>thing? Surely it is attempting to store both an age and the fact that
>an age is not on file in a single column, which also violates first
>normal form.
> It still appears to be a hack imo, and one still ends up
>with 3VL.
> There has to be a more elegant way....Regards, J.
I doubt it. Given this information:
- "Employee Jack is male"
- "Employee Mary is female"
- "Employee Jack is 43 years old"
- "Employee JJ is 32 years old"
how would you answer the below questions:
- "List all employees aged 40 and above".
- "What is the average age of our employees?"
- "For each employee, how many years left until retirement (assume a country with laws for retirement age of 65)"
- "List all employees that are female, under 35 years old, or both"
- "Is JJ older than Mary?"
- etc
I can give answers to all questions above, but I have to use 3VL in all cases. For me, that signifies that 3VL is part of reality and hence can't be left out of a database that attempts to model (aspects of) reality.
Best, Hugo Received on Fri Dec 28 2007 - 23:59:50 CET
