[UPHPU] Database Speed Question

Scott Hill llihttocs at gmail.com
Wed Apr 11 14:19:25 MDT 2007


On 4/11/07, Webot Graphics <graphics at westernbotanicals.com> wrote:
>
> I am preparing to do a movie database of dvds that a friend of mine has.
>
> In a one to many relationship, such as movie ratings (each movie
> having only a US rating for sanity purposes) would it be faster or
> easier on the database to do
>
> this:
>
> Movies Table
>         Movie_ID
>         Movie_Title
>         Movie_Year_Released
>         Rating_ID (linked to Ratings Table)
>
> Ratings Table
>         Rating_ID
>         Rating_Code
>         Rating_Description
>
> or this:
>
> Movies Table
>         Movie_ID
>         Movie_Title
>         Movie_Year_Released
>
> Ratings Table
>         Rating_ID
>         Rating_Code
>         Rating_Description
>
> Rating_Movie_Relationships Table
>         Rating_ID
>         Movie_ID
>
>
> Which one would be the correct way (as per normalization)?


The way I understand it is you can use the first example with one to many
relationship.  In other words, if a movie will only have one rating.

The second example is for many to many relationships.  If a movie can have
more than one rating and a rating could be applied to more than one movie.
You can obviously apply a rating to more than one movie, so the question is,
are you going to allow a movie to have more than one rating.

-- 
Scott Hill

"May you solve interesting problems" - Author Unknown
"A fanatic is one who can't change his mind and won't change the subject." -
Sir Winston Churchill


More information about the UPHPU mailing list