|
Posted by J.O. Aho on 08/03/05 17:43
Michael wrote:
> Hi.
>
> I have often wondered how big sites like imdb.com are made.
>
> How do they make a database with all these actors link to a movie.
> When you find a movie it has maybe 50 people attached to this movie. I geuss
> they don't have a database with Movie title, Actor1, Actors2, Actors3....
> Actor49 and Actor50 with and id (connected to there name in another base)
> written in all of them.
You use "one to many" table, where you may have at least two columns
Movie_id, Actor_id
You make the two columns together to be the primary key, this way you won't
have doublets. Then you may have your Movie_id and then join the "one to many"
table with the Actors table and make a search on those who has the Movie_id
same as for the movie you have just looked up.
//Aho
[Back to original message]
|