Movie(title, year, director, budget, earnings)
Actor(stagename, realname, birthyear)
ActedIn(stagename, title, year, pay)
CanWorkWith(stagename, director)
找到所有成对的艺名(重命名为 stagename1 和 stagename2),使得 stagename1 的演员与 stagename2 的演员在同一部电影中表演,但在该电影中表演的收入较少。
SELECT A.stagename, B.stagename
FROM ActedIn A
LEFT JOIN ActedIn B ON A.title = B.title AND A.year = B.year
AND B.pay > A.pay
WHERE B.name IS NOT NULL
不确定 WHERE B.name IS NOT NULL 是否有效