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

12 lines
418 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*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');