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 distinct film.title , count(rental.rental_id) as rentals_count from film inner join inventory on inventory.film_id=film.film_id inner join rental on rental.inventory_id=inventory.inventory_id group by film.title having rentals_count = (select count(rental.rental_id) as rentals_count from film inner join inventory on inventory.film_id=film.film_id inner join rental on rental.inventory_id=inventory.inventory_id group by film.title order by rentals_count asc limit 1 ) order by film.title asc; ; show status like 'Last_query_cost';

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

Copy Clear