programming-examples/sql/SQLMovieDatabase/23. Write a query in SQL to compute a report which contain the genres of those movies with their average time and number of movies for each genres.sql
2019-11-18 14:05:53 +01:00

8 lines
325 B
SQL

/*23. Write a query in SQL to compute a report which contain the genres of those movies with their average time and number of
movies for each genres.*/
SELECT gen_title, AVG(mov_time), COUNT(gen_title)
FROM movie
NATURAL JOIN movie_genres
NATURAL JOIN genres
GROUP BY gen_title;
ORDER BY mov_dt_rel desc;