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

8 lines
325 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*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;