Schemes
Movie(title, year, director, budget, earnings) Actor(stagename, realname, birthyear) ActedIn(stagename, title, year, pay) CanWorkWith(stagename, director)
I need to find all the actors (stagename and realname) who never worked in a movie that made a profit (profit> budget). So find all the bad actors: P
SELECT A.stagename, A.realname FROM Actor A WHERE A.stagename NOT IN (SELECT B.stagename FROM ActedIN B WHERE EXIST (SELECT * FROM Movie M WHERE M.earnings > M.budget AND M.title = B.title AND M.year))
Will it find all the actors whose name does not appear in the second query? The second query will find all the statuses that acted in the films that made a profit.
Is it correct?
source share