Thanks in advance, i am new to database design and query I have 4 tables namely film_table ,actors_table ,director_table and producer_table as follows:
film_table
(film_id, film_name, actor_id, producer_id, director_id)
actor_table (has a many to many relation with film_table)
(actor_id, actor_name)
director_table (has a many to one relation with film_table)
(director__id, director_name)
producer_table (has a many to one relation with film_table )
(producer_id, producer_name)
I also have a mapping table in the form:
Actor_Film_Mapping
(actor_id, film_id)
I need to query the database in order to obtain the data in following format:
(film_name, actor_name, producer_name, director_name)
I have tried the following Query:
SELECT f.film_name
FROM Film_table f
INNER JOIN Actor_table a
on f.actor_id= a.actor_id
INNER JOIN Actor_Film_Mapping afm
on a.actor_id = afm.actor_id;