Hi i want to list all the song for the album and i want to list all the artist for individual song see below for example.
1. Song Title 1
- Artist 1, Artist 2,
SELECT s.song_name, a.artist_name, al.album_name
FROM artist a
LEFT JOIN song_artist sa ON sa.artist_id = a.id
LEFT JOIN song s ON s.id = sa.song_id
LEFT JOIN album al ON al.id = s.album_id
More info on JOIN
Select s.song_name ,art.artist_name,a.album_name from Song
join song_artist sa on sa.Song_id = s.Song_id
join Album a on a.album_id = s.Album_id
join Artist art on art.id = sa.artist_id
This gets you the songs + artists for album 1.
SELECT song_name, group_concat(artist_name)
FROM song
LEFT JOIN song_artist ON song.id=song_artist.song_id
LEFT JOIN artist ON song_artist.artist_id=artist.id
WHERE song.album_id=1
Note that you did answer this question in another spot as well.