First of all, this is homework. I’ve already thought it over and wrote a solution, but I am a little discouraged by the fact that I cannot successfully profile it or get a second opinion as to whether it is really good.
Let's say I have a simple table of information about participation in the film (person, film, people's attitude to the film), for example:
create table film
(
person_name varchar(48) not null,
film_title varchar(128) not null,
relation varchar(48) not null
);
-- { 'Mel Gibson', 'Braveheart', 'director' }
-- { 'Mel Gibson', 'Braveheart', 'cast' }
-- { 'Steven Spielberg', 'A.I.' , 'director' }
-- { 'Hilary Swank', 'Million Dollar Baby', 'cast' }
-- etc
The database and table are not created and are not supported by me, I just request information from it.
, ( ) , . , , , , . , , , . , " , , ".
(, , ), :
(
select person_name
from film
where relation = 'director'
)
except
(
select person_name
from
(
(
select person_name, film_title
from film
where relation = 'director'
)
except
(
select person_name, film_title
from film
where relation = 'cast'
)
) as director_behind_camera_for_film
)
, , ? , ?
, ( ) - , .