Lists all the gold badges that have been earned by people with less than a given amount of reputation (default: 1k), and displays the number of times each has been awarded to the aforementioned users.
Q&A for professional and enthusiast programmers
SELECT b.Name AS [Badge Name], COUNT(*) AS [Count] FROM Badges b INNER JOIN Users u ON b.UserId = u.Id WHERE u.Reputation < ##rep:int?1000## AND b.Name IN ('Socratic', 'Stellar Question', 'Great Question', 'Famous Question', 'Illuminator', 'Great Answer', 'Populist', 'Reversal', 'Unsung Hero', 'Fanatic', 'Legendary', 'Marshal', 'Constable', 'Sheriff', 'Steward', 'Copy Editor', 'Electorate', 'Publicist') GROUP BY b.Name ORDER BY COUNT(*) DESC