Answers for "sql movie database example"

SQL
0

movie database sql queries

`select Title 
   from Movie m 
   JOIN
   (select MovieID, Rating 
   from Ratings 
   order by
   Rating)
   as r on 
   m.MovieID = r.MovieID
   limit 20;`
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
0

movie database sql queries

select Title from Movie m  
inner join (select top 20 MovieID,sum(Rating) Rate from Ratings group by movieid having count(UserID)>39 order by sum(Rating) DESC) tbl
on m.MovieID=tbl.MovieID
order by tbl.Rate desc
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
  from movies inner join stars_in_movies
 where star_id=%s and movie_id = id;
Posted by: Guest on September-19-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language