Q&A for people interested in the history and origins of science and mathematics
AVG(Cast(pp.Score as Float)) as Average_Score,
SUM(pp.Score) as Score_Sum,
Count(pp.REP_BUCKET) as Post_Count,
pp.REP_BUCKET as Reputation_Bucket
(SELECT TOP 1000
when u.Reputation <= 50 then ' 000 - 50'
when u.Reputation > 50 and u.Reputation <= 100 then '051 - 100'
when u.Reputation > 100 and u.Reputation <= 200 then '101 - 200'
when u.Reputation > 200 and u.Reputation <= 300 then '201 - 300'
when u.Reputation > 300 and u.Reputation <= 400 then '301 - 400'
else 'over 400'
end as REP_BUCKET
FROM Posts p
JOIN Users u ON p.OwnerUserId = u.Id
WHERE p.PostTypeId = 1
AND p.Tags like '%minecraft-commands%'
ORDER BY p.CreationDate DESC) pp
GROUP BY pp.REP_BUCKET
ORDER BY pp.REP_BUCKET DESC