Remove ( ) from the table name and add movie to your second join.
select yr, count(*) from actor join casting on actor.id = casting.actorid join movie on movie.id = casting.movieid group by yr having actor.name='John Travolta'
EDIT:
You need to switch having to where , because havings are used for aggregate functions in connections to your group by .
select yr, count(*) from actor join casting on actor.id = casting.actorid join movie on movie.id = casting.movieid where actor.name = 'John Travolta' group by yr
source share