>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.