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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Question on Primary Keys

Re: Question on Primary Keys

From: Reinier <Reinier_Dickhout_at_hetnet.nl>
Date: Mon, 16 Oct 2000 10:24:06 +0200
Message-ID: <enJ#kq0NAHA.349@net025s>

If the existence of the user is depending on the existence of an organisation unit you should make it a mandatory FOREIGN key, not a primary key. Primary keys are intended to identify the uniqueness of a record in its own table, foreign keys are intended to represent relationships between different entities.

Reinier.

Jan Lenders <J.Lenders_at_Betuwe.net> wrote in message news:8se93i$qm3$1_at_nnrp1.deja.com...
>
> > Each USER belongs to an ORG_UNIT.
> > (a) The USER table can have a combined PK of USER_ID & ORG_UNIT_ID
> > (b) The USER table can have a PK of USER_ID (some sort of unique
> > number) and have ORG_UNIT_ID as a FK.
> >
> Raju,
> If the existence of a USER object is dependent on the existence of a
> ORG_UNIT you should make the ORG_UNIT_ID (foreign key) a primary key in
> the USER table.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Oct 16 2000 - 03:24:06 CDT

Original text of this message

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