I want to get All actors that haven't appeared in R rated films
It was easy to do with sub-queries
select *
from actor
where actor_id not in
(select actor_id
from actor
inner join film_actor using (actor_id)
inner join film using (film_id)
where rating = 'R');
I am unable to do it with joins
-
I have done this till now -
select distinct(a.actor_id), a.first_name, a.last_name
from actor as a
left join
(film_actor as fa
inner join film as f
on fa.film_id = f.film_id)
on a.actor_id = fa.actor_id
where f.rating = 'R'
order by actor_id
In the above query I get all the actors who have worked in R
rated films, but now I am not sure how to get the non R
rated films
Can someone help me do this with joins?