Following eval(BadCode)'s advice, I have created an ERD for my database. However, there are a few questions I've got creating an ERD.
Question 1
The 'teams' table has two foreign keys ("was" and "became") that refer to the primary index in the 'teams' table. That's not a typo; those two keys state previous and subsequent identities of the teams.
For example, the St. Paul Mayors (SPM) became the Huntsville Mayors (HNT), so under the St. Paul Mayors entry, the "became" field has the value "HNT", while the Huntsville Mayors entry has "SPM" in the "was" field.
Question 2
How do I show that multiple foreign keys in a table refer to the SAME key in another table? Under my 'colors' table, "logo_by", "large_logo_by", and "alt_logo_by" all refer to the "cont_id" field in the 'contributers' table. How do I show that?
The first 15 pages is all ERD stuff.
The last 15 pages is all writing queries.
Edit: The first 2 pages are actually an intro.
It's not all words like a book, it's a lot of schema, ERDs, and queries.
A few notes before reading it:
1) the joins at the end are written in longhand. Don't be fooled into thinking you have to do that
2) it might also help to understand what normalization up to 3N is. Past 3N it's just heads. When the data is normalized and you have your ERD... Your database becomes the golden gun from 007. If you don't use stored procedures (I don't) then you might benefit from creating a few views for joining the tables back together.
Last edited by eval(BadCode); 12-24-2010 at 12:15 AM.
Bookmarks