Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
SELECT c.name AS category, avg(rental_rate)AS avg_rental_rate FROM category c left JOIN film_category ON c.category_id = film_category.category_id left join film on film_category.film_id = film.film_id --left JOIN inventory ON film_category.film_id = inventory.film_id --left JOIN rental ON inventory.inventory_id = rental.inventory_id --left JOIN payment ON rental.rental_id = payment.rental_id GROUP BY 1 ORDER BY avg_rental_rate desc

Stuck with a problem? Got Error? Ask AI support!

Copy Clear