Answer the question
In order to leave comments, you need to log in
MySQL - select from multiple tables
It is necessary to make a DB with films. Each film has several titles (Russian, English, etc.), several genres (horror, thriller, etc.), there may be several directors, a lot of actors. I want to scatter everything on different tables (a separate table with actors, directors, genres, etc.). Plus, linking tables will be needed (which movie has which properties).
But something frightens me selection of the list of films. What should be the request to give out titles, genres, and directors. I only know to make a five-story INNER JOIN, but it will probably be very tight.
Point plz. on the right line of thought. Do you have any useful links to read?
Answer the question
In order to leave comments, you need to log in
If there is a lot of data, it makes sense to split the request into several.
Yes, they live like that ...
In MySQL, the GROUP_CONCAT (expr) function helps to live.
Other databases have similar features.
SELECT * FROM films as f
LEFT JOIN films_desc as fd in (fd.film_id=f.id)
LEFT JOIN films_rank as fr in (fr.film_id=f.id)
WHERE f.id = 1;
It should work just fine.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question