The study is joining. This is an important part of using SQL. When you have a select statement that works, examine the “views” and create a new view using the select statement.
To get you started, this is an unverified, from my point of view, example of a select expression using joins. Also note that MySQL is not a tool that I often use, so the syntax is probably incorrect for MySQL.
SELECT A.Title, A.Year, C.Name, D.EventID FROM FILMS A JOIN NOMINATIONS B ON B.FilmID = A.FilmID JOIN AWARDS C ON C.AwardID = B.AwardID JOIN EVENTS D ON D.EventID = B.EventID WHERE EVENTS.EventID = XX
This will work if all relationships exist. Examine the "outer join" to pull out all the rows of a given table, say, FILMS, and include the corresponding row in other tables.
An author named Joe Selco has written several books on complex SQL statements. You may find his work useful.
Hth
source share