16rows
2 columns
Schema from the provider contract| Column | Type | Nullable | Key | References |
|---|---|---|---|---|
category | | yes | — | — |
total_sales | | yes | — | — |
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 DESCData preview
Sample records
| category | total_sales |
|---|---|
| Action | 4375.85 |
| Animation | 4656.3 |
| Children | 3655.55 |
| Classics | 3639.59 |
| Comedy | 4383.58 |
| Documentary | 4217.52 |
| Drama | 4587.39 |
| Family | 4226.070000000001 |