programming-examples/sql/SQLMovieDatabase/48. Write a query in SQL to find the highest-rated Mystery movie, and report the title, year, and rating.sql
2019-11-18 14:05:53 +01:00

12 lines
418 B
SQL

/*48. Write a query in SQL to find the highest-rated Mystery movie, and report the title, year, and rating. */
SELECT mov_title, mov_year, rev_stars
FROM movie
NATURAL JOIN movie_genres
NATURAL JOIN genres
NATURAL JOIN rating
WHERE gen_title = 'Mystery' AND rev_stars >= ALL (
SELECT rev_stars
FROM rating
NATURAL JOIN movie_genres
NATURAL JOIN genres
WHERE gen_title = 'Mystery');