Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do I need a PK?
Message
De
03/04/2001 10:39:10
 
 
À
03/04/2001 10:36:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00491302
Message ID:
00491307
Vues:
11
>I have a table in my Database that just relates to other Parent tables on a one-to-one basis.
>
>I suggested we have a PK of it's own because it doens't have one, but my Analyst said we don't need one because it doesn't have any child tables.
>
>Can I have some views/preferences on this?
>I prefer to always have a PK no matter what?
>

ALL tables need a primary key.

If it's a one to one with another table (it's fields could logically be placed in the other table), then I see no problem with the tables sharing a PK. In other words the primary key for one table would be duplicated in the other. In this sense, the PK is really a foreign key to the main table, but since it's one to one, it's unique enough to use as the PK.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform