SQL Statement for Postgres:
SELECT c.name AS category, ROUND(AVG(f.length), 2) AS average_length FROM film f JOIN film_category fc ON f.film_id = fc.film_id JOIN category c ON fc.category_id = c.category_id GROUP BY c.name;
categorytables to calculate the average length of movies in each category.
JOINkeyword is used to combine the tables based on their respective foreign key relationships.
GROUP BYclause is used to group the results by the category name.
AVGfunction is used to calculate the average length of movies in each category.
ROUNDfunction is used to round the average length to 2 decimal places.