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: Many to Many Relationship with a Twist

Re: Many to Many Relationship with a Twist

From: Jim Gregory <JG200024_at_NCR.com>
Date: 2000/07/21
Message-ID: <397898a4$1@rpc1284.daytonoh.ncr.com>#1/1

Van

Your following relation is unclear:

" Any NEWS item can be associated with C and/or R and/or B".

If you mean to say " Any NEWS item can be associated with 0 or 1 rows in C and/or R and/or B" then you don't have a many to many relationship and you don't need an intersection table.

However, if you mean to say " Any NEWS item can be associated with 0, 1, or more rows in C and/or R and/or B" then you do have a many to many relationship between NEWS and the other tables. If this is the case, I would probably go the intersection route instead of trying to develop a more "elegant" solution. "Elegant" in my experience means more complicated and fraught with gotchas down the road that aren't immediately obvious. Give the developers a break and don't make their jobs any more complicated then it needs to be.
(just my opinion)

HTH

--
Jim Gregory
Principal Consultant for Keane, Inc.
Currently assigned to NCR
"Opinions are my own and do not reflect
  those of Keane or my clients"

Van Messner <vmessnerNOvmSPAM_at_discovernet.com.invalid> wrote in message
news:16160e7a.9245beac_at_usw-ex0106-046.remarq.com...

>
> Imagine three tables C, R and B. C has a primary key of CKEY, R
> is RKEY and B is BKEY.
>
> Another table NEWS has a primary key of NEWSKEY.
>
> C, R and B can all be associated with zero to many NEWS items.
> Any NEWS item can be associated with C and/or R and/or B.
>
> One model is to put an intersection table between NEWS and C,
> NEWS and B, and NEWS and R.
>
> But when I add more tables at the level of C, R and B then I will
> need more intersection tables. Is there a more elegant solution?
> Please be specific about which would be the key and foreign key
> columns of any alternative solution.
>
> Many thanks,
>
> Van
>
>
>
> -----------------------------------------------------------
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>
Received on Fri Jul 21 2000 - 00:00:00 CDT

Original text of this message

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