P
P
PlatinumArcade2011-03-19 01:06:59
MySQL
PlatinumArcade, 2011-03-19 01:06:59

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

3 answer(s)
A
Anatoly, 2011-03-19
@taliban

If there is a lot of data, it makes sense to split the request into several.

I
IlVin, 2011-03-19
@IlVin

Yes, they live like that ...
In MySQL, the GROUP_CONCAT (expr) function helps to live.
Other databases have similar features.

V
Vitali Borovik, 2011-03-19
@WAYS

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 question

Ask a Question

731 491 924 answers to any question