Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: One to One Relationship
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
>
Received on Tue Mar 18 2003 - 18:16:40 CST