yogesh gurav
yogesh gurav

Reputation: 11

Many to many relationship in erd

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.

Upvotes: 1

Views: 1467

Answers (2)

codaddict
codaddict

Reputation: 454912

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.

Upvotes: 0

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65361

For example:

Actor Table:

  • ActorID
  • Actor Name

Film Table:

  • FilmID
  • FilmName

The Connection Table ActorFilm

  • ActorID
  • FilmID

Upvotes: 1

Related Questions