Re: Question on Primary Keys
Date: Wed, 25 Oct 2000 13:51:09 -0400
Message-ID: <sve7d650pg9801_at_corp.supernews.com>
>
> There are two ways to model this in the physical database model
>
> (a) The USER table can have a combined PK of USER_ID & ORG_UNIT_ID
>
How does this affect the ability to do joins? Do you have to seperate the PK into it's parts to do a join? If so, then you should avoid this. The temptation with RDBMS is to make the Application Layer do the work as opposed to the Data Layer. I'd say a simple rule of thumb is, if the database can do the work, make the database do the work.
>
> (b) The USER table can have a PK of USER_ID (some sort of unique number)
> and have ORG_UNIT_ID as a FK.
>
> What advantages/disadvantages are there to each approach ?
>
> Can anyone point me to/provide me some practical pointers on how the
unique
> PKs can be set up
> in Oracle if scenario (a) were to be chosen as the way to go.
>
> Thanks,
>
> Raju
>
>
Received on Wed Oct 25 2000 - 19:51:09 CEST