Hello, I am currently working on an SQL problem that I cannot understand. Here is the diagram I am working with:

Here is the question I'm stuck on:
- 3 Find the first name, last name and total length of the film for films of any level. As a result, the names of all participants should be indicated (even if the actor was not in any Sci-Fi films) and the total length of the Sci-Fi films in which they were.
I still have
SELECT actor.first_name, actor.last_name, (SELECT SUM(film.length)
from film
INNER JOIN film_category
ON film.film_id = film_category.film_id
INNER JOIN category
ON film_category.category_id = category.category_id
INNER JOIN film_actor
ON film_actor.film_id = film.film_id
INNER JOIN actor
ON film_actor.actor_id = actor.actor_id
WHERE category.name = 'Sci-fi'
)
from actor
I know that I need to group it using actor_id, but I cannot do this in the select subquery. Does anyone have any clues?
source
share