Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Data Modeling Question

Re: Data Modeling Question

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Fri, 03 Sep 1999 13:39:02 GMT
Message-ID: <37d0cedd.2970992@netnews.worldnet.att.net>


On Thu, 2 Sep 1999 14:39:09 -0400, "Ioan Berbece" <iberbece_at_servicesoft.com> wrote:

>Suppose I have a table TA which represents entity A and a table TB which
>represents entity B. Between entity A and entity B there is a hierarchical
>relationship meaning an object of type B can have an object of type A as its
>parent. At the same time entity B has a hierarchical relationship with
>itself. The two relationships are exclusive.

What do you mean when you say the two relationships are "exclusive". Do you mean that when B is related to itself that it can't be related to A? I'm unclear on that. However, I would probaly just create two tables, A and B.

  1. B gets a foreign key to parent A.
  2. B gets a foreign key to B.
  3. B gets a check constraint that enforces the rule that if FKB is not null, then FKA must be null, and vice-versa.

regards,

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Fri Sep 03 1999 - 08:39:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US