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: One to One Relationship

Re: One to One Relationship

From: DA Morgan <damorgan_at_exxesolutions.com>
Date: Tue, 18 Mar 2003 18:50:06 -0800
Message-ID: <3E77DADE.23D772AD@exxesolutions.com>


Peter wrote:

> So are you saying that you should never have a one to one relationship in a
> logical database model and thus also in the database?
>
> For example, imagine that you have a table of employees and a table of
> departments that the employees work for. This would be a one to many and
> possible many to many relationship. Now imagine that you also want to
> capture the managers of each department. Each department can only have one
> manager and an employee can only be a manager of one department, so, you
> would need a one to one relationship, called manages, between the employee
> and department table.
>
> How else would you model this? Both entities, employees and departments are
> completely different and thus you couldn't put them in the one table. Maybe
> the database books that I have been reading have been incorrect or has
> database theory changed recently?
>
> 1 1
> |employee| --- <manages> --- |department|
>
> "DA Morgan" <damorgan_at_exxesolutions.com> wrote in message
> news:3E75FB57.28F7E5B0_at_exxesolutions.com...
> > Wayne Hinch wrote:
> >
> > > Hi,
> > >
> > > How can a one to one relationship between two tables be created in
> Oracle
> > > 9i?
> > >
> > > Any help will be much appricated.
> > >
> > > Wayne
> >
> > By ignoring the rules of normalization and deciding to turn a relational
> > database into an electronic version of a bunch of 3x5 cards.
> >
> > You can do it with constraints. You can do it with triggers. And you can
> > decide to be smart and not do it at all. Get a book on relational database
> > theory and normalization and read it.
> >
> > Daniel Morgan
> >

Not at all. 1:1 is often found in a logical model. One normalizes then, where appropriate, denormalizes when creating the physical model.

Same goes for M:M (many to many) relationships. They may exist in a logical model but they absolutely do not belong in a physical model.

Daniel Morgan Received on Tue Mar 18 2003 - 20:50:06 CST

Original text of this message

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