schema I am trying to fetch the movies directed by james cameron.
select mov_title
from movie
inner join movie_direction on movie.mov_id = movie_direction.dir_id
inner join movie_direction on director
where director.fname='james' and director.lname='Cameron';
You cannot refer to the movie_direction table twice in the same query without giving it an alias in at least one of the joins. Give alias in one of your join or in both.
i.e.
Your query should be like this