programming-examples/sql/SQLMovieDatabase/49. Write a query in SQL to generate a report which shows the year when most of the Mystery movies produces, and number of movies and their average rating.sql
2019-11-18 14:05:53 +01:00

9 lines
376 B
SQL

/*49. Write a query in SQL to generate a report which shows the year when most of the Mystery movies produces, and number
of movies and their average rating. */
SELECT mov_year,gen_title,count(gen_title), avg(rev_stars)
FROM movie
NATURAL JOIN movie_genres
NATURAL JOIN genres
NATURAL JOIN rating
WHERE gen_title='Mystery'
GROUP BY mov_year,gen_title ;