The code should be relatively self-explanatory. I was wondering how much rep the Top Voters on sites did "generate" on a site, in comparison to how much rep they "own".
Therefore I created a little SEDE-Query and I am now wondering, if I follow good SQL-Practices and how the performance of the query could possibly be improved (even though it's rather simple already..)
WITH Voters AS( SELECT DISTINCT UpVotes, DownVotes, Id, Reputation FROM Users WHERE Reputation != 101 AND Reputation != 1 --Exclude users without repchanges ) SELECT TOP ##topX:int?20## Users.Id as [UserLink], Users.DisplayName as [SortName], Voters.Upvotes * 8 as [EstimatedAddedRep], --as there is no split between question and answer votes -- we take 8 as median in accordance to the tendency that there are more -- answer votes (10 rep) than question votes (5 rep) Voters.Downvotes * 3 as [EstimatedDestroyedRep], Users.Reputation as [OwnedRep], Voters.Upvotes * 8 / Users.Reputation as [Ratio] FROM Users, Voters WHERE users.id = Voters.Id GROUP BY Users.Id, Users.DisplayName, Users.Reputation, Voters.UpVotes, Voters.DownVotes ORDER BY EstimatedAddedRep DESC
For anyone who wants to run the newest query, you can do so here: Rep "Created" vs Rep "owned" by topX voters