I manage a database for a social network where users can like, comment, and I created a table for each post, for example, and comments.
like
user_id
comment
user_id
Now, when I run select * from post, I want to be able to add two columns likesand one comments, which counts the number of likes and comments each have post_id.
How can i do this?
source
share