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
Cross category actors
no such table: film_actor
Title
northwind.db
sqlite-sakila.db
Connection
What actors work across the most categories of movie?
Description
SQL
WITH actor_category_count AS ( SELECT fa.actor_id, a.first_name, a.last_name, COUNT(DISTINCT fc.category_id) AS category_count FROM film_actor fa JOIN actor a ON fa.actor_id = a.actor_id JOIN film_category fc ON fa.film_id = fc.film_id GROUP BY fa.actor_id, a.first_name, a.last_name ) SELECT actor_id, first_name, last_name, category_count FROM actor_category_count WHERE category_count = (SELECT MAX(category_count) FROM actor_category_count);
Assistant Example
Save & Run
Toggle Dropdown
Save Only
Download...
CSV
JSON
Show 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: 6.802ms. Query created by admin on 2024-05-17.
History