Let’s say I have this database (as an example)

Anyways, I want to make a “most liked” question section but the “likes” are in a different database table hence the likes. Anyways, I have the id of the question being the same thing in question_id… but.. how do I count them in a MYSQL query?
Thanks.
What about using an
inner joinbetween your tables, and agroup byon the question’s ids :This should get you the 10 most-liked questions, with, for each one of those, the number of times it’s been liked.