I am developing a movie cataloger that will rely on an SQL database to store data. I'm not a database developer, and frankly, I'm not so seasoned with anything other than basic database queries. My question is the most efficient way to do the following.
Currently I have created 5 tables
Movies ------ [id] integer [title] nvarchar(100) [duration] integer [year] datetime People ------ [people_id] integer [person] nvarchar(100) Writers ------- [id] integer [people_id] integer Directors --------- [id] integer [people_id] integer Actors ------ [id] integer [people_id] integer
Basically, many, many relationships using the conversion table, films-> writers-people, films-> directors & People, and finally films-> actors and people. The People table is a pool from which you can extract the data needed for each role. Since a person can be a director and a movie star, writer and director, or even all three roles, I figured these three transition tables would solve this. Naturally, a person can be in many films. So I decided that this is the way to do it.
I read about how to set up many relationships in many web articles, and the more I read, the more I get confused about how to set up this situation. Most of them simply do one field or use an analogue of the author / book, which does not help me understand how to implement my situation.
As said earlier, my question is, is this an effective way to do this? Or even right?
I want to be able to easily request a movie and get all the information related to it in a form.
Thanks -Res
source share