programming-examples/sql/SQLMovieDatabase/35. Write a query in SQL to return the reviewer name, movie title, and number of stars for those movies which rating is the lowest one.sql

10 lines
393 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*35. Write a query in SQL to return the reviewer name, movie title, and number of stars for those movies which rating is
the lowest one. */
SELECT reviewer.rev_name, movie.mov_title, rating.rev_stars
FROM reviewer, movie, rating
WHERE rating.rev_stars = (
SELECT MIN(rating.rev_stars)
FROM rating
)
AND rating.rev_id = reviewer.rev_id
AND rating.mov_id = movie.mov_id;