Re: Modeling question...

From: Philipp Post <Post.Philipp_at_googlemail.com>
Date: Wed, 9 Jul 2008 01:11:17 -0700 (PDT)
Message-ID: <121f4dc7-ca51-4a31-b8f5-28b88a9c18fc_at_c65g2000hsa.googlegroups.com>


Volker,

> How does one model relationships in which
- one child table has several parent tables - each parent record can refer to several child records <

I would use relationship tables for them. These will contain the keys of the parent and the child table as foreign key and will compose the primary key of these two columns.

> - each child record belongs to exactly one parent record in exactly one of the several parent tables? <

There, you could insert a column containing the key of the primary table into the child table as a foreign key if you have such a direct relationship.

I would not put all the relations into one table only. You could not not properly enforce foreign key and other constraints there and would create a collection of unrelated things in it what will be hard to manage. Having a lot of relationship tables should basically not be an issue, if they are named consistently and meaningfull.

brgds

Philipp Post Received on Wed Jul 09 2008 - 10:11:17 CEST

Original text of this message