You can't reliably recreate that as not all reputation gained and lost is kept in SEDE.
A close approximation would be this query.
It joins the questions and answers with the posttags table (notice the use of coalesce because answers don't have tags, so we want the question postid for those) and then with the tags tabel. By taking the sum of the score of a post and then grouping on the owneruserid we should get a close enough result that gives you plenty of insight.
DECLARE @tagName nvarchar(35) = '##tagName##'
Select Top 100
OwnerUserId as [User Link]
, sum(score) score
, count(*) [# posts]
, sum(case posttypeid when 1 then score else 0 end) [question score]
, sum(case posttypeid when 2 then score else 0 end) [answer score]
, sum(case posttypeid when 1 then 1 else 0 end) [# questions]
, sum(case posttypeid when 2 then 1 else 0 end) [# answers]
from Posts p
inner join posttags pt on pt.postid = coalesce(p.parentid, p.id)
inner join tags t on t.id = pt.tagid
Tagname = @tagName
and owneruserid is not null
and posttypeid in (1,2) -- only questions and answers
and communityowneddate is null -- only include posts that give reputation
group by owneruserid
order by sum(score) desc
if you want to run this on the datadump, you'll find that you'll be missing the posttags table. You can then remove those inner joins and instead do:
Tags like '%<' + @tagName + '>%'
That will cause a full table scan on the Posts table so grab some coffee if you're hosting it on an under-powered boxx.
For the PHP tag, this will be the result today:
and here is the screenshot from the PHP top users page:
Keep in mind SEDE is updated once a week, on Sunday.
Give a big shout-out to Monica Cellio for the awesome SEDE Tutorial she wrote.
Say "Hi" in SEDE chat.