SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SELECT a.first_name, a.last_name, COUNT(fa.film_id) AS film_count, COUNT(DISTINCT fc.category_id) AS cat_count FROM actor a INNER JOIN film_actor fa USING(actor_id) INNER JOIN film_category fc USING(film_id) WHERE EXISTS GROUP BY a.first_name, a.last_name ORDER BY film_count DESC, a.last_name

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear