数据库结构
MovieInfo (mvID, title, rating, year, length, studio)
DirectorInfo(directorID, firstname, lastname)
MemberInfo(username, email, password)
ActorInfo(actorID, firstname, lastname, gender, birthplace)
CastInfo(mvID*, actorID*)
DirectInfo(mvID*, directorID*)
GenreInfo(mvID*, genre)
RankingInfo(username*, mvID*, score, voteDate)
询问
我需要找到喜剧电影数量最多的导演。(我还需要使用 ALL 运算符)。我的理解是获得以下列表mvid where genre = 'Comedy" and directorid
:
select mvid
from genreinfo
where genre = 'Comedy'
union all
select directorid
from directorinfo
;
但是,我如何计算特定导演拥有的电影数量呢?以及如何获得“喜剧”电影数量最多的那一部?