I have a list of TV shows stored in 1 table. Another table stores show genres (action, romance, comedy).
Most shows usually have more than 1 genre, so having a single tv_genre column and putting the genre ID in there isn't an option.
I could create a look up table which would store tv show id + genre id, and I could insert 1 row for every genre associated with the show.
Where things get fuzzy for me is when I want to output a list of shows on the index, and genre names associated with the tv show. How would I tie the 3 tables together into 1 efficient query (instead of running a separate query for each item on index, getting its genres).
For the purposes of this post, the tables are as follows
TV Show Table
- tv_id
- tv_name
Genre Table
- genre_id
- genre_name
Thanks!