programming-examples/sql/SQLMovieDatabase/30. Write a query in SQL to return the reviewer name, movie title, and stars for those movies which reviewed by a reviewer and must be rated.sql
2019-11-18 14:05:53 +01:00

9 lines
530 B
SQL

/*30. Write a query in SQL to return the reviewer name, movie title, and stars for those movies which reviewed by a reviewer
and must be rated. Sort the result by reviewer name, movie title, and number of stars. */
SELECT rev_name, mov_title, rev_stars
FROM reviewer, rating, movie
WHERE reviewer.rev_id=rating.rev_id
AND movie.mov_id=rating.mov_id
AND reviewer.rev_name IS NOT NULL
AND rating.rev_stars IS NOT NULL
ORDER BY rev_name, mov_title, rev_stars;