When and Why to normalise?
View Single Post
12-01-2007, 07:51 AM
Join Date: Apr 2005
Location: Kent, UK
Not really a good example.
genre_name will be unique, so then adding a unique id to it in the seperate table forces a join when you wish to return the value of genre_name in a query, as well as storing unnecessary information. Besides when entering data into the movie table, what makes more sense - genre = 7 or genre = comedy ? (Although the user may never see the id of course, depending on your interface)
And you missed out the link table - movie_genre (mid, genre) where mid is movie's id and genre is the different genres that a single movie may belong to EG a single movie could be comedy, and action, and Japanese. As this would be a multi-valued column, this is one important reason why it requires normalisation.
table schema: movie--<movie_genre>--genre
Normalisation should be done based on functional dependancies to remove redundant repetative data and multi-valued data (although a little de-normalisation certainly helps at times).
View Public Profile
Send a private message to Dr John
Visit Dr John's homepage!
Find More Posts by Dr John