Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Design Question
Message
From
19/02/2002 18:51:35
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00622027
Message ID:
00622267
Views:
25
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform