09-08-2007, 12:08 AM
|
#1 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Posts: 165
Thanks: 0
|
When and Why to normalise?
As a rule of thumb, if a peice of data will ever be dynamically categorised then you need to normalise it, normalisation is normally done by creating an additional table and using it as a referance.
For example, say you have a table for:
movies:
id
name
genre
genre, could be many different varietys, thus needs to be normalised so something like:
movies:
id
name
genre (foreign_key genre.id)
Genre:
id
genre_name
Would be the normalised way of doing things, linking via id's. This is much easier to manipulate, and because you are using id's instead of repeating the genre it will save a hell of a lot of space in the long run!
|
|
|
|