Q&A for professional and enthusiast programmers
SELECT Badges.UserID, COUNT(Badges.Id) AS Badges, Users.Reputation FROM Badges JOIN Users ON Badges.UserId = Users.Id GROUP BY Badges.UserId, Users.Reputation ORDER BY Users.Reputation DESC;