Im working on a movie data set that has tables for movies, genre and a bridge table in\_genre.
The following query tries to find common genres between two movies. Im doing two joins to get the genre list and a intersect to find common genres.
Is there a more efficient way?

Table schema:

* movie : movie\_id(PK)(int)
* in\_genre(bridge\_table): movie\_id(FK)(int), genre\_id(int)

```
SELECT count(*) as common_genre 
FROM(
    // getting genres of first movie
    SELECT in_genre.genre_id
    FROM movie INNER JOIN in_genre ON movie.id = in_genre.movie_id
    WHERE movie.id = 0109830

    INTERSECT

    // getting genres of second movie
    SELECT in_genre.genre_id
    FROM movie INNER JOIN in_genre ON movie.id = in_genre.movie_id
    WHERE movie.id = 1375666
) as genres

```