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
Rentals per category
no such table: rental
Title
northwind.db
sqlite-sakila.db
MSSQL
trial
Connection
Description
SQL
WITH rental_info AS ( SELECT r.rental_id, fc.category_id FROM rental r JOIN inventory i ON r.inventory_id = i.inventory_id JOIN film_category fc ON i.film_id = fc.film_id ) SELECT c.name AS category_name, COUNT(ri.rental_id) AS rental_count FROM rental_info ri JOIN category c ON ri.category_id = c.category_id GROUP BY c.name ORDER BY 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: 26.152ms. Query created by admin on 2024-05-17.
History