I would like to get the list of questioners who asked the most questions per tag. Can you please advise me how to write such a query? I do not care about the reputation of questioners, I care about the quantity of questions they ask.
Here is a SEDE query: Users with most questions in a given tag.
SELECT TOP(##num?100##) q.OwnerUserId AS [User Link], q.OwnerDisplayName, COUNT (q.Id) AS [Question Count], SUM (q.Score) AS [Total Score] FROM Posts q INNER JOIN PostTags pt ON q.Id=pt.PostId INNER JOIN Tags t ON t.id = pt.TagId WHERE t.TagName=##tagName:string?data-explorer## GROUP BY q.OwnerUserId, q.OwnerDisplayName ORDER BY COUNT (q.Id) DESC
EDIT: I have changed the query following rene's suggestion in the SEDE chatroom. He pointed out that I made an unnecessary join with Users table in the query. And also that using the PostTags table is better then my original version, where I checked
Tags LIKE '%<##tagName##>. (Some further minor points: Addition of OwnerDisplayName ensures that the users who have deleted their accounts aren't added all together as one user. I have also omitted
PostTypeId=1 which is now unnecessary - only questions have tags.)
As already mentioned in the comments, even without using SEDE the top askers and answerers in a given tag (ordered by total score) are listed on the site. For each tag you have link to "Top Users", here is such link for the (data-explorer) tag.
It's slightly more complicated to get number (or score) for answerers, since you need look at the answer for the owner and at the question for the tag. Here are the queries for all answers and non-CW answers.