Re: circular relationships URGENT

From: Heinz Huber <Heinz.Huber_at_elbanet.co.at>
Date: 2000/05/09
Message-ID: <3917A0AE.51EDD200_at_elbanet.co.at>#1/1


Hi!

Fernando wrote:
>
> On Mon, 08 May 2000 10:21:47 +0200, Heinz Huber
> <Heinz.Huber_at_elbanet.co.at> wrote:
>
> >As I understand you, it is no circular relationship:
> >
> >customer 1 : n addresses
> >customer 1 : n orders
> >address 1 : n orders
> >
> >The relationship customer to orders is redundant, but might be kept for
> >performance reasons.
>
> Hhmmm... OK, but actually I have two types of addresses (billing and
> shipping), so I would have an n to n relationship. Any ideas about
> how to make it 1 to n? O:-)

As long as it's exactly two addresses, you'd have a 2 : n relationship (which is simply 2 times 1 : n) best modelled by two FKs in orders. As Mark pointed out, you could also relate the addresses to the order detail level (which you didn't show).

With those two addresses, I'd surely include the customer id in the orders table. This can be important, if the customers of the addresses are not consistent.

hth
Heinz Received on Tue May 09 2000 - 00:00:00 CEST

Original text of this message