I want to retrieve one complete object from VIDEOPLAYLIST that contains the complete USER object and all the VIDEO objects related to it.
I understand that I will need to use LEFT JOIN to merge them, but I cant understand how i should setup my PLAYLIST table and how to query it when it comes to multiple VIDEO id's.
This is my current database EER Diagram:
Should I create a many to many relationship between the playlist and video? Should I somehow store all the VIDEO id's in the PLAYLIST table? And then how would be able to query it?
This is where I'm stuck:
SELECT * FROM videoplaylist LEFT JOIN user LEFT JOIN video ON user.id = playlist.user_id AND videos....
PS. I won't just be querying one PLAYLIST at the time, as I need to display them in a list format.