我如何选择不出现在另一个表中的记录

Smi*_*ter 0 sql sqlite

表:电影

mID title                   year    director
101 Gone with the Wind  1939    Victor Fleming
102 Star Wars           1977    George Lucas
103 The Sound of Music  1965    Robert Wise
104 E.T.                    1982    Steven Spielberg
105 Titanic                 1997    James Cameron
106 Snow White          1937    <null>
107 Avatar                  2009    James Cameron
108 Raiders of the Lost Ark 1981    Steven Spielberg
Run Code Online (Sandbox Code Playgroud)

表:评级

rID mID stars   ratingDate
201 101 2   2011-01-22
201 101 4   2011-01-27
202 106 4   <null>
203 103 2   2011-01-20
203 108 4   2011-01-12
203 108 2   2011-01-30
204 101 3   2011-01-09
205 103 3   2011-01-27
205 104 2   2011-01-22
205 108 4   <null>
206 107 3   2011-01-15
206 106 5   2011-01-19
207 107 5   2011-01-20
208 104 3   2011-01-02
Run Code Online (Sandbox Code Playgroud)

我需要获取尚未评价的电影.在这种情况下,泰坦尼克号(mID 105)和星球大战(mID 102)从未获得评级表中的费率.

我弄清楚了

从电影中选择不同的movie.title,评级为rating.mid!= movie.mid,但从电影中选择不同的movie.title,评级为rating.mid = movie.mid

但是我觉得它可能有更好的(更简单/更清洁)的方法.

r.n*_*net 5

简单:

SELECT Movies.* FROM Movies LEFT JOIN Rating ON Movies.mID = Rating.mID WHERE Rating.mID IS NULL
Run Code Online (Sandbox Code Playgroud)