I have a lot of questions about MySQL when I have to use INNER JOIN
to get data from other tables.
I have 3 tables:
MEDIA
id, user_id, title, description
COMMENTS
id, user_id, media_id, comment
MEDIA_LIKES
id, user_id, media_id
The MEDIA table is the main one, it contains id do post
and id do usuário
, then I have the comments table where the comments are posted in certain posts and then the like
given in these posts as well.
My big question is how through a Query in MySQL I can get the data from the MEDIA
table, the amount of comments and the likes
data for given media_id
?