Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Echodarkstar00
.
Toggle Highlighting
SQL
#Preliminary approach: return user edit counts, a field already tracked by wikis. #caveats: not accurate, for details refer to Manual:user table, user_editcount #time complexity: slow for large wikis/more users #SELECT DISTINCT user.user_id, user.user_name, user.user_editcount FROM user #INNER JOIN user_groups ON user.user_id = user_groups.ug_user -- join with user_group table using id to find if user is a bot #WHERE NOT(user_groups.ug_group = 'bot') -- exclude bots from selection #ORDER BY user_editcount DESC #LIMIT 10 #Inner join / Extracting all revisions made by all users that have made a revision in this wiki SELECT DISTINCT actor.actor_name as Editor, COUNT(revision.rev_actor) AS Num_Edits FROM actor INNER JOIN revision ON actor.actor_id = revision.rev_actor #INNER JOIN user_groups ON actor.actor_user = user_groups.ug_user -- join with user_group table using id to find if user is a bot #WHERE NOT(user_groups.ug_group = 'bot') -- exclude bots from selection GROUP BY Editor ORDER BY Num_Edits DESC LIMIT 10 #Interestingly, the two approaches above result in slightly different rankings #Some user edit counts are undercounted and some are overcounted in the first approach #Since it doesn't involve a join, first approach is faster
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...