MySQL Forums
Forum List  »  Newbie

Re: Help with the best table layout for message board
Posted by: Rick James
Date: November 29, 2009 06:31PM

Hard to give a black-and-white answer...

Normalization serves multiple purposes:
* Shrink the data in the 'fact' table, thereby being more efficient (usually)
* Make it easier to change the spelling of the normalized item. This is useful, say, for company_name -- think how often companies change their name. Or whether their could be a typo the first time.
* In the process of normalizing out the company name, you get the bright idea of having a Company table, with the name, location, etc. This, in itself, leads to a cleaner schema design.
* Synonyms -- Sometimes you need one 'id' for an entity, but it might have multiple 'names'.

IP address of the user, the timestamp, etc are fields that do not apply in any of the above. So, I would argue against normalizing.

name VARCHAR(8) -- user id? Assuming user ids never change, don't bother to normalize. Even if a user id could change, how would you ever know that the new id is the 'same' as the old one? You may have another table of info on the Users (a la the Company table, above); this would have userid VARCHAR(8) as the PRIMARY KEY.

Options: ReplyQuote


Subject
Written By
Posted
Re: Help with the best table layout for message board
November 29, 2009 06:31PM


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.