Ejercicios agrupados

Número de películas para cada actor

Número de clientes por tienda

Total de ventas (amount) por película

Total de ventas(amount) por categoría


SELECT first_name,last_name,count(film_id) total
FROM actor join film_actor using(actor_id)
group by actor_id

select store.store_id, count(customer_id) total
from customer join store using(store_id)
group by store_id

select title,sum(amount) total from film join inventory using (film_id)
join rental using (inventory_id)
join payment using (rental_id)
group by film_id

select category.name, sum(amount) total
from category join film_category using (category_id)
join film using (film_id)
join inventory using (film_id)
join rental using (inventory_id)
join payment using (rental_id)
group by category_id -- comentario