instruction: Eligible to vote on controversial Docs edit.
response: SELECT b.Name, SUM(CASE WHEN b.Class = 1 THEN 1 ELSE 0 END) AS Gold, SUM(CASE WHEN b.Class = 2 AND u.Reputation > 5000 THEN 1 ELSE 0 END) AS "Silver + 5k", SUM(CASE WHEN b.Class = 3 AND u.Reputation > 10000 THEN 1 ELSE 0 END) AS "Bronze + 10k", 1 AS "Jon Skeet" FROM (SELECT UserId, Name, MIN(Class) AS class FROM Badges WHERE TagBased = 'true' GROUP BY UserId, Name) AS b LEFT JOIN Users AS u ON u.Id = b.UserId GROUP BY b.Name ORDER BY Gold, 'Silver + 5k', 'Bronze + 10k'