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

Home -> Community -> Usenet -> c.d.o.misc -> Re: n:m relationship and ORACLE8

Re: n:m relationship and ORACLE8

From: Daniel Clamage <dclamageNOSPAM_at_telerama.com>
Date: 1998/07/12
Message-ID: <01bdadc1$f7f5dae0$2529c9cd@saturn>#1/1

Same way you'd do it with O7. Use a third table (called a tertiary table) to combine the primary keys of two other tables. These primary keys are the only columns in the tertiary table. Example: table DEPT, primary key deptno
table EMP, primary key empno
tertiary table DEPT_EMP, non-unique key deptno, empno If you put an index on the tertiary table, make sure it's non-unique so you can do m:n entries. Since every column in the table is also in the index, you can use the index table feature, which is more efficient.

-- 
- Dan Clamage
http://www.telerama.com/~dclamage
If you haven't crashed the Server,
you haven't been trying hard enough.

hkoch_at_freiburg.netsurf.de wrote in article
<35a8817d.824004_at_news.freiburg.netsurf.de>...

> Hello everybody,
>
> What is the best way to implement an n:m relationship with
> the new object-relational features of ORACLE8 ??
>
> Thanks in advance,
> -Marco Koch
>
> _______________________________________
> Marco Koch
> koch_at_informatik.uni-freiburg.de
> http://www.informatik.uni-freiburg.de/~koch/cs/
> _______________________________________
>
Received on Sun Jul 12 1998 - 00:00:00 CDT

Original text of this message

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