1. Bloggers
blogger_id
1
2
3
2. Posts
post_from_blogger_id
1
1
1
2
2
3
As
Try this:
SELECT B.blogger_id,
B.blogger_name,
IFNULL(COUNT(P.post_from_blogger_id ),0) AS NumPosts
From Blogger AS B
LEFT JOIN Posts AS P ON P.post_from_blogger_id = B.blogger_id
GROUP BY B.blogger_id, B.blogger_name
ORDER BY COUNT(P.post_from_blogger_id ) DESC
This joins the 2 tables, and counts the number of entries in the Posts
table. If there are none, then the count is 0 (IFNULL).