Re: Proposal: 6NF
Date: 5 Oct 2006 16:59:39 -0700
Message-ID: <1160092779.793797.20540_at_i3g2000cwc.googlegroups.com>
On Oct 5, 10:21 pm, Sampo Syreeni <d..._at_iki.fi> wrote:
> On 2006-10-05, Bob Badour wrote:
>
> > So, you are saying that laying zero eggs includes the inapplicability
> > of the whole concept of laying anything. If zero suffices, why NULL?Because a bird that has laid zero eggs might then be observed to lay
> more, and we would want to assign a nonzero value to its eggs_laid. With
> camels it's different.
>
> >> Furthermore, at the time your code is expected to be finalized, you
> >> only know that there will be animals, some of which lay eggs, but you
> >> don't know which kinds of properties all of the animals eventually
> >> described in the database might have.
>
> > Ah, but one will have to know what those are before one commits the schema
> > and one will have to know the properties of interest before one writes a
> > query.The whole point of my exercise was that judicious use of nulls allows
> you to escape the first half, at least in this one case. In my opinion
> such separation of concerns is a worthy design goal, because schemas
> tend not to be entirely static and added dependent attributes are
> perhaps the most common form of real life schema evolution.
> --
> Sampo Syreeni, aka decoy - mailto:d..._at_iki.fi, tel:+358-50-5756111
> student/math+cs/helsinki university,http://www.iki.fi/~decoy/front
> openpgp: 050985C2/025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2
If you had two relations:
Animals (id [PK], name)
Egg_layers (id [FK], eggs_laid)
and you want a count of animals that lay few eggs (assuming a few eggs is 5 or less) or aren't egg laying at all, would the following not do the job without any null kludges?
SELECT COUNT(1)
FROM Animals
ANTIJOIN Layers
ON Animals.id = Layers.id
WHERE Layers.eggs > 5
Perhaps I have misunderstood the issue, given my confusion at this darn new google groups interface... Received on Fri Oct 06 2006 - 01:59:39 CEST