Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: n:m relationship and ORACLE8
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>...Received on Sun Jul 12 1998 - 00:00:00 CDT
> 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/
> _______________________________________
>
![]() |
![]() |