Answers for "useful sql queries for movie database"

SQL
0

movie database sql queries

select director
  from movies inner join stars_in_movies
 where star_id=%s and movie_id = id;
Posted by: Guest on September-19-2020
0

movie database sql queries

select first_name --All stars who have not acted with star X
from stars
where star_id not in
(
    select star_id --All stars who have acted with star X
    from stars_in_movies
    where movie_id in
    (
        select movie_id     --All movies in which star X has acted
        from stars_in_movies
        where star_id = "X"
    )
)
Posted by: Guest on September-19-2020
0

movie database sql queries

select director -- directors who have worked with star X
from movies
where movie_id in
(
    select movie_id  --All movies in which star X has acted
    from stars_in_movies
    where star_id = "X"
)
Posted by: Guest on September-19-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language