Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Design Question
Message
De
19/02/2002 18:51:35
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00622027
Message ID:
00622267
Vues:
24
>My question is of normalization:
>
>If I have an Invoices table which is related to a Clients table, is it
>proper to store the Client's name in the invoice table, or the primary
>key from the Client table?
>
>I'v always beleived in storing the primary key. The problem is, you can
>then no longer delete the client record, because you would have a dangling
>reference in the Invoice table.
>
>If you store the client's name, you can at any time remove the client record
>and still know who the invoice was for, but if the client's name changes, you
>have to go through all table and change the name.
>
>Anyone have any thoughts on this?
>
>Thanks

Really, it doesn't make sense to delete a client if you have information for the client in other tables. So, RI is no bad idea.

Save the client name only if you think it will change, and you want the historical information.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform