I have two Postgres tables: playlists
and tracks
.
I've created playlists_tracks
which is the many_to_many relationship between playlists and tracks.
Tracks contain multiple columns, but the one I'm looking at is artist
.
What is the fastest way to query a list of all playlists that contain at least one track with an artist name containing, say, "The Beatles"? I'm having a hard time wrapping my head around an efficient way to do this.