muriel
First, I would like to say I am impressed -- you started the right way in that you looked at what you wanted for your outcomes. I have seen many who start the other way and then wonder why they can not get the results they want in their reports.
Before proceeding, you may wish to review rules of Normalization.
I would tweak the design presented by NPSHr in the event you have any many-to-many relationships
tblOrg
OrgID (autonumber, primary key)
OrgName (text)
- plus other information you want to track unique to organization
tblAuthor
AuthID (autonmber, primary key)
AuthName (text, 25 to 35)
- other author information you want to track
tblPublication
'I am assuming that the publisher and organization are different
'I am assuming publication is different than pbulisher
PubID (autonumber, primary key)
PubType (text, 10 to 25, newspaper, journal, trade mag, etc.)
PubName (text, 25 to 50, name of your "source" - "New York Times", etc)
Publisher (text, 25 to 50, you can actually have th epublisher on a different table)
City (text, 25 to 35)
- plus other stuff unique to the publication
tblArt
'Published article
ArtID (autonumber, primary key)
Volume (text or numeric - text probably better)
PageNo (numeric or text - do you get "A1" and "C1" for "page numbers?)
- other info you want to track on bibliography that is unique to bibliography
- we will revisit the design for this table later...
Now for the fun stuff, and this will depend on how you answer some questions. The decision that has to be made is whether there is a one-to-many (1:M) or many-to-may (M:M) relationship. This will affect how you "join" your tables.
Basically 1:M would be an invoice "header" with customer info, purchase order, etc and the invoice "detail" with details for each item on the invoice - product no., prices, quantity, etc. Here, the invoice detail and invoice header is joined using the invoice number stored on each invoice detail record.
A M:M: is more complex. An example is teachers and students in a high school. A teacher can teach many students taking different subjects. A student can have many (well more than one) teacher. Here, you can not store the teacher ID on the student record and you can not store the student ID on the teacher record. You tie the two together using course which includes both the teach and student ID records. (Sorry for going off on a tangent, but this is important since you have to answer the questions.)
Objective: Determine relationship between Author and Organization and answer your questions...
1) Authors and all organizations associated with them
3) Organizations and all authors associated with them
(Again - kudos for asking questions!)
- Can an author write articles for more than one organization?
- Can an organization have more than one author?
If no to either, then store the ID on the "many" side. For example an author writes only for one organization but an organization can have more than one author. For tblAuth, add
AuthID (numeric, long, forein key to author)
eg: tblAuth (will now look like...)
'Assume author belongs to only one organization
AuthID (autonmber, primary key)
AuthName (text)
OrgID (numeric, long, foreign key to organization
If yes to both, you have a M:M. Need to create a relation or join or "profile" table linking both. Your original design suggest that you will have a M:M relationship.
eg: tblAuthOrg
AuthID (numeric, long, foreign key to author)
OrgID (numeric, long, foreing key to orgnization)
- Primary key is AuthID + OrgID
- add other information you want to track unique to an orgnization and author, i.e. owner of orgnization, chief publisher, etc.)
Objective, Next, answer your second question -- Determine relationship between author and articles
2) Authors and all source titles (or articles) associated with them
- Can an author write more than one publication?
- Can a publication have more than one author?
Repeat the analysis for 1:M vs M:M. (I suspect if you are restricting yourself to newspaper articles, you may be able to get away with a 1:M. But if you are including medical and scientific articles, you will have a M:M. Your original design suggest a M:M)
If you will only have one author for an article, then your article table may look like..
eg: tblArt will now look like...
'Published article
ArtID (autonumber, primary key)
AuthID (numeric, long, foreign key to author)
Volume (text or numeric - text probably better)
PageNo (numeric or text - do you get "A1" and "C1" for "page numbers?)
If you have a M:M, and not a 1:M, you have to again create a profile or join table...
tblArtAuth
ArtID (numeric, long, foreign key to article)
AuthID (numeric, long, foreign key to author)
- plus anything unique to the author and article
But we are not done with the publication article table. We have to repeat the process of determining either a 1:M or M:M relationship for the publisher.
For simplicty, I am going to assume that you have a 1:M relationship for publication and articles (a publication has many articles but an article has only one publication), and I am going to assume that you do indeed have a M:M for articles and athors. An example of your artcle table would look like...
eg: tblArt
'Published article
ArtID (autonumber, primary key)
PubID (numeric, long, foreign key to publication)
Volume (text or numeric - text probably better)
PageNo (numeric or text - do you get "A1" and "C1" for "page numbers?)
I saved the best for last -- keywords. I suspect you will have a M:M relationship, and this will become the most powerful part of your database.
I have two thoughts on this. The normalized table would be...
tblKeyW
ArtID (numeric, long, foreign key to publication article)
KeyWord (text, is this going to be one word or allow a phrase??)
Primary key would be ArtID + Keyword
BUT, I think I would use an autonumber on this instead for practicle considerations...
tblKeyW
KeyID (autonumber, primary key)
ArtID (numeric, long, foreign key to publication article
KeyWord (text, again, are you going to allow just one word or a phrase)
You can force the Article + Keyword to unique so as to avoid duplicates.
Does this work?
1) Authors and all organizations associated with them
If an author works for only one orgnation
select tblAuth.*, Org.* from tblAuth, tblOrg where tblOrg.OrgID = tblAuth.OrgID
But for a M:M using the join table tblAuthOrg
(I used Access query for this...)
SELECT tblAuth.*, tblAuthOrg.*
FROM (tblAuth INNER JOIN tblArtAuth ON tblAuth.AuthID = tblArtAuth.AuthID) INNER JOIN tblAuthOrg ON tblAuth.AuthID = tblAuthOrg.tblAuth;
2) Authors and all source titles associated with them
(Going to assume M:M)
SELECT tblArtAuth.*, tblAuth.*
FROM tblAuth INNER JOIN (tblArt INNER JOIN tblArtAuth ON tblArt.ArtID = tblArtAuth.ArtID) ON tblAuth.AuthID = tblArtAuth.AuthID;
3) Organizations and all authors associated with them
Reverse of 1.
Lastly, keywords...
To get Articles using key words...
SELECT tblArt.ArtID, tblKeyW.KeyWord
FROM tblArt INNER JOIN tblKeyW ON tblArt.ArtID = tblKeyW.ArtID;
To get Authors using key words... (A little longer, but it works)
SELECT tblAuth.AuthName, tblArt.ArtID, tblKeyW.KeyWord
FROM tblAuth INNER JOIN ((tblArt INNER JOIN tblKeyW ON tblArt.ArtID = tblKeyW.ArtID) INNER JOIN tblArtAuth ON tblArt.ArtID = tblArtAuth.ArtID) ON tblAuth.AuthID = tblArtAuth.AuthID;
Hope this helps
Richard