I am wondering about the best way to model this for when there are multiple artists for a given song.
id song_title artist
=================================================
1 Battle Sirens Knife Party, Tom Morello
2 Internet Friends Knife Party
3 Satisfy Nero
Where ultimately I want it to work like this:
id song_title artist
=================================================
1 Battle Sirens [1,2]
With an artist table like this:
id artist_name
===================
1 Knife Party
2 Tom Morello
3 Nero
It makes the most sense to me to have each artist field as a string containing an array of artist ids: "[1,2]", but this doesn't seem like the right way to do it in just SQL.
The only other things I can think to do are:
- Have a new table for combinations of artists with an arbitrary identifier.
- Have an 'assoc' table where there are two records for the same song id when there are two artists behind it.