after watching some tutorials, I feel like I am still confused about cardinality when it comes to one to many
and many to many
relationship. I am trying to practice a little example here, I know my design is wrong when it comes to cardinality, what would be the correct relationship between these entities ?? I get confused when I have 3 table relationship like FilmPeople
and FilmGenre
Asked
Active
Viewed 397 times
2

Ris
- 1,892
- 9
- 26
- 43
1 Answers
2
Relationships look right. There are some problems though.
- Naming convention: You should name
People
table asPerson
because you don't have plural naming anywhere else. - Name
FilmDirector
table asDirector
. See next point for why. Once you do thatDirector
table should not havefilm_ID
column. - Your model has a mixture of logical and physical model. Let me explain. Relationship between
FilmDirector
andFilm
is a logical many-to-many relationship. When that relationship is physically created in a database it goes throughFilm
->FilmDirector
andDirector
->FilmDirector
tables withFilm
toFilmDirector
one-to-many andDirector
toFilmDirector
one-to-many relationships.FilmDirector
table connectsFilm
andDirector
tables to establish many-to-many relationship. Therefore I suggest naming yourFilmDirector
table asDirector
so that the connection table can be correctly named asFilmDirector
. Such a connection table is needed in many-to-many relationship because it is not possible to put multiple values of foreign key references in one table row. Entries go in the connection table for every row in one table being related to multiple rows in other table. In this example for relating oneFilm
with multipleDirector
s we make multiple entries inFilmDirector
table. Similarly for relating oneDirector
with multipleFilm
s we make entries inFilmDirector
table. - Relationship you have shown between
Film
,FilmGenre
andGenre
is a physical many-to-many betweenFilm
andGenre
. If your model is a logical model you should not show this as a 3 table relationship. If the model is a physical model you should showFilm
andDirector
many-to-many as a 3 table relationship. So, decide whether you want to show physical model or logical model and change your model accordingly.
Hope my explanation is clear enough!

RaviH
- 3,544
- 2
- 15
- 14
-
you said filmDirector table as Director , so what if Film (meaning the film itself) has to be directed by one or more directors ? would I still have not have FilmDirector and Film...thats why I put it there – Ris Jan 22 '14 at 03:34
-
edit: yes I was thinking Film with multiple Directors or just one – Ris Jan 22 '14 at 03:38
-
thank you so much!...I went over this one more, I'm glad you told me the difference between logical and physical many to many relationship..wish I could give you 10 likes – Ris Jan 22 '14 at 03:49