Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Normalization question
Message
De
12/08/1999 11:52:13
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00253018
Message ID:
00253035
Vues:
16
>I've been working on a larger project (for me) lately where there will ultimately be 150+ tables. On most of the other projects I've done, I haven't given much thought to normalization. I've looked back on them and most of them seem to be normalized anyways. On this project I've started really looking at how tables are related, etc.
>
> The one issue that has come up is how foreign keys are handled in the normalization process. I started noticing some of my tables (let's call it "Main") have a foreign key to another table ("middle")a foreign key to some third table. Is it bad form to include a direct foreign key in my "main" table? Or is this a case of "it depends"?

Please forgive if I'm stating obvious stuff to you...

This three table arrangement is usually employed to solve the many-to-many data relationship.

e.g. a student can take many classes and each class contains many students.

Because relational databases cannot handle this scenario directly, a third intermediate table is used - in this case it might be called StudentAttendsClass.

The three tables are then set up in a one-to-many-to-one relationship which gives the same outcome as the many-to-many required.

SO, in short, if this is the case, NO - don't link directly to the third table.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform