|
Posted by J.O. Aho on 08/04/05 18:51
Berislav Lopac wrote:
> J.O. Aho wrote:
>
>>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.
>
>
> In that specific case, this table also probably has additional fields like
> character name etc.
Most likely not, as you don't want to repeated the same data that many times
in a table, the data about the actor will be found in the Actors table in this
case.
//Aho
Navigation:
[Reply to this message]
|