MySQL Forums
Forum List  »  Newbie

Less Is More, or?
Posted by: Amy Peters
Date: April 08, 2010 06:56AM

Hi,

I've been reading up about relational database normalization, but there's something I would be grateful if someone could clarify for me:

If I have articles written by various members, I would have a table for articles and one for members. Do I need a third table to link the two (containing only articleIDs and userIDs) or would the userID for each article author do just as well within the article table. For example when querying to find all articles by a given member, will the slimline third table provide effeciency savings, or does the extra table/step in the process actually do the opposite?

When I say do the opposite, I mean for example, when displaying an article it will be showing you who has written it. If the author member is a column in the row of the article table than the information gets pulled out with the rest of the article details. However, if there's a seperate table that links articleID and userID than it's an extra step to find out who wrote it.

Also, in the proposed third table I assume that the articleID would have to be the primary key as it's unique (only one member can be the author of each article) and userID is not. However, I would also be doing queries on the userID in this table (as above, to find out which articles are by a given member). So what kind of key would the userID be best set as?

Thanks



Edited 5 time(s). Last edit at 04/08/2010 07:06AM by Amy Peters.

Options: ReplyQuote


Subject
Written By
Posted
Less Is More, or?
April 08, 2010 06:56AM
April 08, 2010 07:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.