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

Home -> Community -> Usenet -> comp.databases.theory -> Re: unique primary key shared between multiple tables.

Re: unique primary key shared between multiple tables.

From: programmer <BROWNHIK_at_Syntegra.Bt.Co.Uk>
Date: Fri, 14 Mar 2003 10:49:37 -0000
Message-ID: <b4sch2$bk5$1@pheidippides.axion.bt.co.uk>

"ben" <benc_at_email.arizona.edu> wrote in message news:71915a6e.0303132131.6480504c_at_posting.google.com...
> In one of my database design textbooks, I ran across the following
> line:
>
> PropertyForRent(propertyNo, ownerNo)
>
> Foreign Key ownerNo references PrivateOwner(ownerNo) and
> BusinessOwner(ownerNo)
>
> This implies that I can make PrivateOwner.ownerNo and
> BusinessOwner.ownerNo unique not just for thier respective tables, I
> can make ownerNo unique across both tables. In other words, no
> PrivateOwner.ownerNo may have the the same value as any
> BusinessOwner.ownerNo.
>
> This would be extremely usefull, but I can't find any way to actually
> implement a shared primary key between tables. How do I do this?

Put all private owners and business owners in the same table, distinguished by a flag. Received on Fri Mar 14 2003 - 04:49:37 CST

Original text of this message

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