Re: foundations of relational theory?

From: Anthony W. Youngman <thewolery_at_nospam.demon.co.uk>
Date: Mon, 27 Oct 2003 00:51:47 +0000
Message-ID: <r3qJkaIjwGn$Ewb1_at_thewolery.demon.co.uk>


In article <LHpmb.22537$Tr4.49381_at_attbi_s03>, Marshall Spight <mspight_at_dnai.com> writes
>"Anthony W. Youngman" <thewolery_at_nospam.demon.co.uk> wrote in message news:Ko91h
>KAyFDj$EwOn_at_thewolery.demon.co.uk...
>>
>> My favourite example is always to quote an invoice. How many tables do
>> you need in a relational database? One for the invoice itself, one for
>> the addresses (two at least, billing and shipping), one for the line
>> detail, a couple maybe for the relationships ...
>
>For some customers, ship-to and bill-to are the same address.
>For others, they are not the same. Let's say you discover
>that a street name is misspelled on the ship-to address
>for a customer. You update the record. If ship-to and
>bill-to are the same address, do you have to do another
>update? Is it possible to have the two addresses out-of-sync,
>even though, for this customer, they are the same address?
>
Well, they appear twice on the invoice, so I would probably have modelled them as two separate attributes. So yes, I would have to modify both copies.

But you have to get clear in your mind - are you looking at it as one building (which it is, in which case it's an entity and would complicate the model horribly), or as part of the information on the invoice, in which case they are two separate attributes and *have* to be stored twice, needing two modifications. But that's not redundant because shipping address is not the same attribute as billing address (as is proven by the fact that they do not have to be the same).

Anyway, if the invoice has been posted, surely correcting it is the same thing as post-facto corrupting the data! :-)

Cheers,
Wol

-- 
Anthony W. Youngman - wol at thewolery dot demon dot co dot uk
Witches are curious by definition and inquisitive by nature. She moved in. "Let 
me through. I'm a nosey person.", she said, employing both elbows.
Maskerade : (c) 1995 Terry Pratchett
Received on Mon Oct 27 2003 - 01:51:47 CET

Original text of this message