Arqade [minecraft-commands] average score per user reputation

1

Please login or register to vote for this query.

(click on this box to dismiss)

Arqade

Q&A for passionate videogamers on all platforms

SELECT 
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
FROM

(SELECT TOP 1000 
p.Score,
case 
   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

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results