views:

34

answers:

2

I am creating database for entertainment application. In this movies,video songs,mp3 songs like entities are included. In this movie & actors,actresses,music directors,male singers, female singers have many to many relationships. i.e. an actor works in zero or many movies & a movie includes one or many actors. so my question is how to make these tables.

+1  A: 

For example:

Actor Table:

  • ActorID
  • Actor Name

Film Table:

  • FilmID
  • FilmName

The Connection Table ActorFilm

  • ActorID
  • FilmID
Shiraz Bhaiji
A: 

Your actor table would look like:

[ actorID Name Age....]

Your movies table could look like

[ movieID Name release_date....]

where actorID and movieID are primary keys. Now the many-to-many relationship between them can be represented as another table say starring as:

[ movieID actorID ]

a row in this table implies that the movie with the given ID has the actor with actorID in that row as a star.

codaddict