「Ang Lee」の監督名に基づいて映画名を取得するなど、特定のクエリを実行しようとしています。Movie と Director を 2 つのテーブルに分けています。映画 ID と監督 ID を持つ 3 番目のテーブルがあり、すべてを結び付けようとしています。したがって、私がしなければならないことの 1 つは、'Ang Lee' という名前で監督された映画 (MId、タイトル、リリース日) を見つけることです。この結果を得るには、どのタイプのクエリを送信する必要がありますか? ここに私のコードの背景があります:
CREATE TABLE MOVIE(
MId INTEGER,
Title VARCHAR(50),
ReleaseDate DATE,
Budget DOUBLE,
PRIMARY KEY (MId)
);
CREATE TABLE DIRECTOR(
DId INTEGER,
Name VARCHAR(30),
DateOfBirth DATE,
PRIMARY KEY (DId)
);
CREATE TABLE DIRECTED(
DirectorId INTEGER,
MovieId INTEGER,
PRIMARY KEY(DirectorId, MovieId),
FOREIGN KEY(DirectorId) REFERENCES DIRECTOR(DId),
FOREIGN KEY(MovieId) REFERENCES MOVIE(MId)
);
INSERT INTO MOVIE VALUES(1, 'Life of Pi', '2012-11-21', 120000000);
INSERT INTO MOVIE VALUES(3, 'Argo', '2012-10-12', 44500000);
INSERT INTO MOVIE VALUES(7, 'The Dark Knight Rises', '2012-07-20', 250000000);
INSERT INTO MOVIE VALUES(15, 'Thor', '2011-12-10', 150000000);
INSERT INTO MOVIE VALUES(45, 'The Sessions', '2012-01-23', 1000000);
INSERT INTO MOVIE VALUES(65, 'Batman Begins', '2005-06-15', 150000000);
INSERT INTO MOVIE VALUES(86, 'Goodfellas', '1990-09-19', 25000000);
INSERT INTO MOVIE VALUES(95, 'The Departed', '2006-10-06', 90000000);
INSERT INTO MOVIE VALUES(103, 'There's Something about Mary', '1998-07-15', 23000000);
INSERT INTO MOVIE VALUES(123, 'The Matrix', '1999-05-31', 63000000);
INSERT INTO MOVIE VALUES(144, 'Lust, Caution', '2007-09-28', 15000000);
INSERT INTO DIRECTOR VALUES(4, 'Ang Lee', '1954-10-23');
INSERT INTO DIRECTOR VALUES(5, 'Ben Affleck', '1972-08-15');
INSERT INTO DIRECTOR VALUES(8, 'Christopher Nolan', '1970-07-30');
INSERT INTO DIRECTOR VALUES(9, 'Kenneth Branagh', '1960-12-10');
INSERT INTO DIRECTOR VALUES(13, 'Ben Lewin', '1946-01-23');
INSERT INTO DIRECTOR VALUES(23, 'Martin Scorsese', '1942-11-17');
INSERT INTO DIRECTOR VALUES(25, 'Christopher Nolan', '1970-07-30');
INSERT INTO DIRECTOR VALUES(33, 'Peter Farrelly', '1956-12-17');
INSERT INTO DIRECTOR VALUES(34, 'Robert Farrelly', '1958-06-17');
INSERT INTO DIRECTOR VALUES(45, 'Lana Wachowski', '1965,06-21');
INSERT INTO DIRECTOR VALUES(46, 'Andrew Wachowski', '1967-12-29');
INSERT INTO DIRECTED VALUES(4, 1);
INSERT INTO DIRECTED VALUES(5, 3);
INSERT INTO DIRECTED VALUES(8, 7);
INSERT INTO DIRECTED VALUES(9, 15);
INSERT INTO DIRECTED VALUES(13, 45);
INSERT INTO DIRECTED VALUES(25, 65);
INSERT INTO DIRECTED VALUES(23, 86);
INSERT INTO DIRECTED VALUES(23, 95);
INSERT INTO DIRECTED VALUES(33, 103);
INSERT INTO DIRECTED VALUES(34, 103);
INSERT INTO DIRECTED VALUES(45, 123);
INSERT INTO DIRECTED VALUES(46, 123);
INSERT INTO DIRECTED VALUES(4, 144);