Do 10% of Users Hold 90% of the Reputation on Stack Overflow


Please login or register to vote for this query.

(click on this box to dismiss)

It's commonly said that 10% of the worldwide population have 90% of the wealth. This query aims to check the distribution of wealth (reputation-wise) of users on Stack Overflow to see if there is a correlation.

Stack Overflow

Q&A for professional and enthusiast programmers

declare @TotalRep bigint
declare @UserCount bigint
declare @Top10RepTotal decimal(18,4)
declare @Bottom90RepTotal decimal(18,4)

select @TotalRep = sum(reputation) from users

select @UserCount = count(1) from users where reputation > 2

select @Top10RepTotal = sum(tmp.rep) from
          (select top(1) percent reputation as rep
           from users
           order by reputation desc) as tmp

select @Bottom90RepTotal = sum(tmp.rep) from
          (select top(99) percent reputation as rep
           from users
           order by reputation) as tmp

select @TotalRep TotalRep,
       @UserCount UserCount,
       @Top10RepTotal Top1RepTotal,
       @Bottom90RepTotal Bottom99RepTotal,
       cast((@Top10RepTotal/@TotalRep)*100 as decimal(18,4)) Top1PercentageOfRep,
       cast((@Bottom90RepTotal/@TotalRep)*100 as decimal(18,4)) Bottom99PercentageOfRep

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results