INSERT and SELECT query I am trying to insert 5-star ratings by James Cameron for all movies in the database. Review date must be leaving as NULL.
Here are my tables


My way is:

INSERT INTO rating(stars)
SELECT rating.stars FROM rating
INNER JOIN movie
ON rating.mID = movie.mID
WHERE rating.stars='5'
AND movie.director='James Cameron'
AND rating.ratingDate IS NULL;


Why does my query doesn't work as expected? It just returned my empty set.
because where rating.stars = 5 rating.ratingdate is not null.

Hence your select part gets no data to insert.