programming-examples/sql/SQLMovieDatabase/32. Write a query in SQL to find the movie title, and the highest number of stars that movie received and arranged the result according to the group.sql
2019-11-18 14:05:53 +01:00

8 lines
405 B
SQL

/*32. Write a query in SQL to find the movie title, and the highest number of stars that movie received and arranged the
result according to the group of a movie and the movie title appear alphabetically in ascending order. */
SELECT mov_title, MAX(rev_stars)
FROM movie, rating
WHERE movie.mov_id=rating.mov_id
AND rating.rev_stars IS NOT NULL
GROUP BY mov_title
ORDER BY mov_title;