Skip to content

Instantly share code, notes, and snippets.

@vbilopav
Created June 17, 2023 15:00
Show Gist options
  • Save vbilopav/c70f412fdaf7ab60b7263d2c35f4a513 to your computer and use it in GitHub Desktop.
Save vbilopav/c70f412fdaf7ab60b7263d2c35f4a513 to your computer and use it in GitHub Desktop.
select
title,
name,
avg(score)
from movies m
join movies_actors using(movie_id)
join actors a using(actor_id)
join (
select movie_id
from actors join movies_actors using(actor_id)
where actors.name = 'Zendaya'
) sub using(movie_id)
left outer join reviews using(movie_id)
group by
title,
name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment