Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Question on Primary Keys
Jan Lenders <J.Lenders_at_Betuwe.net> wrote in message > In this case that's
true, since the user_id is "some kind of unique
> number".
> In case a supplier (Sup_Id) can deliver goods (Goody_Id) these goods
> are dependent and it should be realy wise to take the composite key
> (Sup_Id, Goody_ID) as the primary key, since the Goody_Id values can be
> used by many suppliers.
> I guess we're both right; one should consider the uniqueness of the
> candidate keys for each and every table. The rule of thumb says
> "foreign keys of dependent relationships become primary keys".
> That's also the way that many design tools work.
>
>
Will this composed goody-supplier key be the primary key of the Supplier or
Goody table?
I think in this case you don't want to depent on naming convention of your supplier but you will maintain your own goody-table. Each goody will have a unique number or code and a primary supplier and a supplier_goody_code that is not part of the primary key but that is indexed.
I'm not saying every table should have an id-column for a PK, but I am saying a PK should describe the entity and not the relationships if possible. In case of m:n relations rules are different and composed PK do apply. Received on Mon Oct 16 2000 - 09:24:18 CDT
![]() |
![]() |