select daybook.userid, count(*) as count
from daybook, rating
where daybook.userid = rating.userid
group by daybook.userid
order by count desc
लेकिन आपको वास्तव में डेबुक टेबल की भी आवश्यकता नहीं है:
select userid, count(*) as count
from rating
group by userid
order by count desc