SQL Explorer
Demo Environment
This environment resets nightly. Any data or connections you add are public.
SQL Explorer
New Query
Playground
Connections
Annotations
Logs
Favorites
Store rental rankings
no such table: rental
Title
northwind.db
sqlite-sakila.db
Connection
what are the most successful stores? Which rent the most movies?
Description
SQL
WITH StoreRentals AS ( SELECT i.store_id, COUNT(r.rental_id) AS rental_count FROM rental r INNER JOIN inventory i ON r.inventory_id = i.inventory_id GROUP BY i.store_id ) SELECT s.store_id, s.manager_staff_id, s.address_id, sr.rental_count FROM StoreRentals sr INNER JOIN store s ON sr.store_id = s.store_id ORDER BY sr.rental_count DESC;
Assistant Example
Save & Run
Save Only
Download...
CSV
JSON
Show Schema
Hide Schema
SQL Assistant
Loading...
Assistant prompt
"Ask Assistant" to try and automatically fix the issue. The assistant is already aware of error messages & context.
Ask Assistant
Avg. execution: 17.460ms. Query created by admin on 2024-05-17.
History