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
ag
no such table: film_payment
Title
sqlite-sakila.db
chinook_1.db
Connection
describe the tables and the function
Description
SQL
WITH FilmPaymentSummary AS ( SELECT fp.film_id, SUM(p.amount) as total_payment FROM film_payment fp JOIN payment p ON fp.payment_id = p.payment_id GROUP BY fp.film_id ORDER BY total_payment DESC LIMIT 5 -- Let's assume we want the top 5 films for simplicity ), FilmActors AS ( SELECT fa.film_id, a.first_name, a.last_name FROM film_actor fa JOIN actor a ON fa.actor_id = a.actor_id ) SELECT f.title, fp.total_payment, fa.first_name, fa.last_name FROM FilmPaymentSummary fp JOIN film f ON fp.film_id = f.film_id JOIN FilmActors fa ON fa.film_id = fp.film_id;
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