← All tables and views

Sakila view

sales_by_film_category

Native view in the Sakila sample database.

16rows

2 columns

Schema from the provider contract
ColumnTypeNullableKeyReferences
categoryyes——
total_salesyes——

View definition

CREATE VIEW "sales_by_film_category" AS SELECT c.name AS category , SUM(p.amount) AS total_sales FROM payment AS p INNER JOIN rental AS r ON p.rental_id = r.rental_id INNER JOIN inventory AS i ON r.inventory_id = i.inventory_id INNER JOIN film AS f ON i.film_id = f.film_id INNER JOIN film_category AS fc ON f.film_id = fc.film_id INNER JOIN category AS c ON fc.category_id = c.category_id GROUP BY c.name ORDER BY total_sales DESC

Data preview

Sample records

16 rows available
categorytotal_sales
Action4375.85
Animation4656.3
Children3655.55
Classics3639.59
Comedy4383.58
Documentary4217.52
Drama4587.39
Family4226.070000000001