How to find top quality users by category?

Was looking for how to find most valuable user in a specific category and find this, wonder how to utilize a simliar query based on category.

I was trying to query on post by category id but find the category id is not presented on posts table.