Thursday, March 29, 2012

directors, actors, films (was "SqlPlus query. Need some help")

What i want to find is the following:

Find first and lastname for all female directors who have directed more than 5 movies,
and have used the same actor in all of their movies.

I've done the first part of this query which lists female directors with more than 5 movies:

select firstname, lastname
from person
where gender = 'F' AND personid in
(select personid
from participation
where partname = 'director'
group by personid
having count(personId)>5)
order by surname;

Now, how do I find the directors that have used the same actor in all of their movies?

5957HOMEWORK! :) :)

how do you define an actor? and when you say "have used the same actor in all of their movies" does this mean any actor or all actors?

by the way, you shouldn't have participation_id as the primary key of Participation -- the primary key should consist of the pair of columns person_id, film_id|||1. an actor is defined to participate in a film whenever partname = 'actor'.

2. Any actor is sufficient

No comments:

Post a Comment