advanced sql exercises on movie database code example
Example 1: movie database sql queries
select first_name,last_name
from stars_in_movies inner join stars
where movie_id=%s and star_id=id;
Example 2: movie database sql queries
select A.first_name
from stars A,
(
select star_id
from stars_in_movies
where movie_id = "X"
)B,
(
select star_id
from stars_in_movies
where movie_id = "Y"
)C
where A.star_id = B.star_id
AND B.star_id = C.star_id