title
stringlengths
1
212
description
stringlengths
1
4.39k
query
stringlengths
1
65.5k
extra_info
stringlengths
18
31.6k
wikidb
stringlengths
4
26
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim 3/4 roku
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim roku
USE plwikisource_p; SELECT actor_name FROM (SELECT COUNT(*) AS n, actor_name FROM revision JOIN actor ON rev_actor = actor_id JOIN user_groups ON actor_user = ug_user JOIN page ON page_id = rev_page WHERE ug_group = 'editor' AND rev_timestamp > '20220625000000' AND page_namespace % ...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 1}], "runningtime": "0.05"}
plwikisource_p
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim 3/4 roku
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim roku
USE plwikisource_p; SELECT actor_name , n FROM (SELECT COUNT(*) AS n, actor_name FROM revision JOIN actor ON rev_actor = actor_id JOIN user_groups ON actor_user = ug_user JOIN page ON page_id = rev_page WHERE ug_group = 'editor' AND rev_timestamp > '20220625000000' AND page_namespace...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 17}], "runningtime": "0.06"}
plwikisource_p
Files on mr.wiki oi
null
#USE ocwiki_p; SELECT CONCAT("# [[:File:", oi_name, "]]") AS file, actor_name #, GROUP_CONCAT(c.cl_from SEPARATOR ' ¤¤¤ ') #SELECT oi_name#, oi_archive_name FROM oldimage #WHERE oi_archive_name = "" #FROM image #JOIN page # ON page_namespace = 6 #AND page_title = img_name JOIN actor_image ON oi_actor = actor_id #JOI...
{"resultsets": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %", "Blocked"], "rowcount": 37}], "runningtime": "2.53"}
mrwiki_p
All orphan no-licensed and non-free files on mr.wiki
null
#USE sqwiki_p; SELECT CONCAT('# [[:File:', REPLACE(REPLACE(p.page_title, '"', '**DOUBLEQUOTE**'), '_', ' '), ']]') FROM page p INNER JOIN categorylinks c1 ON p.page_id = c1.cl_from LEFT JOIN imagelinks i ON p.page_title = i.il_to #AND (i.il_from_namespace = 0) #LEFT JOIN categorylinks c2 ON p.page_id = c2.cl_from AND c...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 1}], "runningtime": "0.05"}
mrwiki_p
Explicit deletions at midnight
null
select distinct substring(log_timestamp, 1, 8) from logging_userindex join actor on log_actor = actor_id where actor_name = "Explicit" and log_type = "delete" and log_action = "delete" and log_timestamp like "20______0001%" order by log_timestamp desc;
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 31}], "runningtime": "0.53"}
enwiki
Count of links to redirects within ns0
null
SELECT COUNT(*) FROM redirect JOIN page ON page_id=rd_from AND page_namespace=0 JOIN pagelinks ON pl_namespace=0 AND pl_from_namespace=0 AND pl_title=page_title WHERE rd_namespace=0
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 1}], "runningtime": "0.06"}
enwiki_p
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim 3/4 roku
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim roku
USE plwikisource_p; select page_title from page where page_title like '%"%' limit 10000;
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 11}], "runningtime": "0.06"}
plwikisource_p
Find pages without recent revisions: en
null
select p.page_title as 'Title', group_concat(c.cl_to) as 'Categories', r.rev_timestamp as 'Last edit date', concat('https://en.wikipedia.org/wiki/', p.page_title) as 'URL' from page p join revision r on p.page_latest=r.rev_id join categorylinks c on c.cl_from=p.page_id where p.page_namespace=0 and p.page_is_redirec...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 0}], "runningtime": "0.05"}
enwiki
zhwiki: Lowest pageIDs in Wikibooks namespaces
null
SELECT page_title, page_id, page_len FROM page WHERE page_namespace='4' # 0/1 main 2/3 user 4/5 wp 6/7 file 8/9 mediawiki 10/11 template # 12/13 help 14/15 cat 100/101 portal 118/119 draft 710/711 timedtext 828/829 module # 2300/2301 gadget 2302/2303 g. def -1 speci...
{"resultsets": [{"headers": ["URL"], "rowcount": 0}], "runningtime": "74.92"}
zhwikibooks
Biographical articles without WP Biography tag
playing around with the query scheme to see what effect things have on performance; a bit slower with the redundant sub-SELECT, but not much. Repeating to see whether there's some sort of schema optimization going on. Now producing wiki markup so this can be easily cut-and-pasted into WP Now uses LEFT JOIN so I can d...
SELECT CONCAT("* [[",article.page_title, "]]") -- , talk.page_id AS talk_page_id FROM page AS article LEFT JOIN page AS talk ON talk.page_title = article.page_title AND talk.page_namespace = 1 AND talk.page_is_redirect = 0 WHERE -- article.page_id % 10 = 2 article.page_namespace = 0 AND article.page_is_red...
{"resultsets": [{"headers": ["user", "cnt"], "rowcount": 166}], "runningtime": "1.84"}
enwiki_p
orphaned talks
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["edits", "edits_per_day", "actor_name", "user_editcount"], "rowcount": 8}, {"headers": ["avg_edits_per_day"], "rowcount": 1}, {"headers": ["edits", "edits_per_day", "actor_name", "user_editcount"], "rowcount": 9}, {"headers": ["avg_edits_per_day"], "rowcount": 1}], "runningtime": "2.28"}
enwiki_p
Seiten mit Nummer im Lemma und unpassender numerischer Sortierung
Beispiel: https://de.wikipedia.org/w/index.php?title=Europastra%C3%9Fe_651&diff=prev&oldid=232189382
SELECT page_title, pp_value FROM page, page_props WHERE page_namespace = 0 AND page_title RLIKE "[1-9][0-9]+" AND pp_page = page_id AND pp_propname = 'defaultsort' AND pp_value RLIKE "^[1-9][0-9]+$" AND page_title NOT LIKE CONCAT("%", pp_value, "%")
{"resultsets": [{"headers": ["reviews", "rc_title", "accepted", "accept %", "declined", "decline %"], "rowcount": 6642}], "runningtime": "9.53"}
dewiki_p
select count(*) from categorylinks
null
select count(*) from categorylinks
{"resultsets": [{"headers": ["page_title"], "rowcount": 0}], "runningtime": "0.39"}
enwiki_p
select (distinct cl_to, cl_from) from categorylinks
null
select count(distinct cl_to, cl_from) from categorylinks
{"resultsets": [{"headers": ["Username", "cnt"], "rowcount": 66}], "runningtime": "476.63"}
enwiki_p
Wikhttps://quarry.wmcloud.org/i Loves Folklore 2023 in Ukraine Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [{"headers": ["title", "count"], "rowcount": 5}], "runningtime": "0.06"}
commonswiki_p
Wikidata - list of properties (German labels)
null
SELECT CURRENT_DATE; SELECT CONCAT('P', term_entity_id), term_text from wb_terms WHERE term_entity_type = 'property' AND term_language = 'de' and term_type = 'label' ORDER bY term_entity_id desc;
{"resultsets": [{"headers": ["actor_name", "last_edit"], "rowcount": 80}], "runningtime": "30.45"}
wikidatawiki
Users contributions in Wikimedia Commons
Contributions to Wikimedia Commons
SELECT r1.rev_timestamp, actor_name, page_title, comment_text, page_id FROM revision_userindex r1 JOIN actor_revision ON actor_id = r1.rev_actor LEFT JOIN page ON page_id = r1.rev_page LEFT JOIN comment_revision ON comment_id = r1.rev_comment_id AND r1.rev_timestamp > '20200131183100' AND r1.rev_timestamp < '202...
{"connection_id": 173889718}
commonswiki_p
orphaned talks
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["pl_title", "COUNT(*)"], "rowcount": 3}], "runningtime": "0.69"}
enwiki_p
Liz's query
null
SELECT page_title FROM page, redirect WHERE page_id = rd_from AND rd_interwiki = '' AND page_namespace = 0 AND NOT EXISTS ( SELECT 1 FROM page WHERE page_title = rd_title AND page_namespace = rd_namespace )
{"resultsets": [{"headers": ["pl_title", "COUNT(*)"], "rowcount": 0}], "runningtime": "0.29"}
enwiki_p
Userspace pages of non-existent users (no talk, no subpages)
null
SELECT CONCAT('https://en.wikipedia.org/wiki/User:', p.page_title) AS URL FROM enwiki_p.page p LEFT JOIN enwiki_p.user u ON REPLACE(p.page_title, '_', ' ') = u.user_name WHERE p.page_namespace = 2 AND u.user_id IS NULL AND p.page_is_redirect = 0 AND NOT IS_IPV4(p.page_title) -- Exclude IPv4 AND NOT IS_IPV6(p.page_title...
{"resultsets": [{"headers": ["ss_total_edits"], "rowcount": 1}, {"headers": ["SUM(user_editcount)"], "rowcount": 1}, {"headers": ["user_id", "user_name", "user_editcount", "user_admin", "user_bot"], "rowcount": 831}], "runningtime": "6.51"}
enwiki_p
jvws - Most active editors on Kompetisi Wikisource 2023
Number of edits in page namespace.
# https://id.wikimedia.org/wiki/Kompetisi_Wikisource_2022 SELECT actor.actor_name AS naraguna, COUNT(actor.actor_name) AS gunggung FROM page JOIN revision ON page.page_id=revision.rev_page JOIN actor ON revision.rev_actor=actor.actor_id WHERE page.page_namespace=250 # Mandhala aran: "Kaca:" AND revision.rev_timestamp...
{"resultsets": [{"headers": ["page_title"], "rowcount": 378}], "runningtime": "0.67"}
jvwikisource_p
jvws - Most edited pages on Kompetisi Wikisource 2023
Number of edits in page namespace.
# https://id.wikimedia.org/wiki/Kompetisi_Wikisource_2022 SELECT rc_title AS irah_irahan, COUNT(*) AS gunggung FROM recentchanges WHERE rc_namespace = 250 # Mandhala aran: "Kaca:" AND rc_timestamp BETWEEN '20230306000000' AND '20230320000000' GROUP BY 1 ORDER BY 2 DESC LIMIT 50;
{"resultsets": [{"headers": ["page_title"], "rowcount": 375}], "runningtime": "0.71"}
jvwikisource_p
Userspace pages of non-existent users (no talk, no subpages)
null
SELECT CONCAT('https://en.wikipedia.org/wiki/User:', p.page_title) AS URL FROM enwiki_p.page p LEFT JOIN enwiki_p.user u ON REPLACE(p.page_title, '_', ' ') = u.user_name WHERE p.page_namespace = 2 AND u.user_id IS NULL AND p.page_is_redirect = 0 AND NOT IS_IPV4(p.page_title) -- Exclude IPv4 AND NOT IS_IPV6(p.page_title...
{"resultsets": [{"headers": ["sum(rev_len)"], "rowcount": 1}], "runningtime": "61.30"}
enwiki_p
orphaned talks
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 4557}], "runningtime": "4.01"}
enwiki_p
WikiGap 2023 on UkWP
null
USE ukwiki_p; SET SESSION group_concat_max_len = 10000; SELECT @rownum := @rownum + 1 AS rank, IFNULL(actor_name, 'Всього'), created, total_len, articles FROM ( SELECT CONCAT('[[Користувач:', actor_name, '|', actor_name, ']]') as actor_name, COUNT(1) AS created, SUM(article.page_len) as...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 1}], "runningtime": "0.06"}
ukwiki_p
Wikhttps://quarry.wmcloud.org/i Loves Folklore 2023 in Ukraine Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [{"headers": ["p", "p\u0422\u041c\u041f1", "p\u0422\u041c\u041f2", "new_text"], "rowcount": 2}], "runningtime": "0.06"}
commonswiki_p
sp2.1
null
# Simplified query to focus on blocked editors. # The page_id list can be manually compiled by looking at page id under "page information" in the Wiki web interface, # or by running Quarry query #62940 with a list of titles. select page_title as 'page title', user_name, comment_text as 'block reason' from page,...
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 88}], "runningtime": "0.53"}
enwiki
Deletion rates of CX and non-CX articles for a wiki
For one wiki, shows how many articles were created using Content Translation (CX articles) and how frequently they were deleted, compared to articles created using other methods (non-CX articles).
SET @start_time = '20200101'; -- 1 Jan 2020 SET @end_time = '20220101'; -- 1 Jan 2021 SET @cx_tag_id = ( SELECT ctd_id FROM change_tag_def WHERE ctd_name = 'contenttranslation' ); WITH nondeleted_new_articles AS ( SELECT SUM(IF(ct_tag_id = @cx_tag_id, 1, 0)) AS cx, SUM(IF(ct_tag_id IS N...
{"resultsets": [{"headers": ["title", "count"], "rowcount": 5}], "runningtime": "0.06"}
gdwiki_p
Broken Redirect
Broken redirect
SELECT CONCAT_WS("", "# [[", p1.page_title, "]]"), p1.page_namespace FROM redirect AS rd JOIN page p1 ON rd.rd_from = p1.page_id LEFT JOIN page AS p2 ON rd_namespace = p2.page_namespace AND rd_title = p2.page_title WHERE rd_namespace >= 0 AND p2.page_namespace IS NULL ORDER BY p1.page_namespace ASC;
{"resultsets": [{"headers": ["Tables_in_knwiki_p"], "rowcount": 90}], "runningtime": "0.14"}
pswiki
unreviewed pages
null
WITH RECURSIVE Cat AS ( SELECT page_title, page_id FROM page WHERE page_title = "Biologie" AND page_namespace = 14 UNION SELECT Subcat.page_title, Subcat.page_id FROM page AS Subcat, categorylinks, Cat WHERE Subcat.page_namespace = 14 AND cl_from = Subcat.page_id AND cl_to = Cat....
{"resultsets": [{"headers": ["user_id", "user_name", "user_real_name", "user_password", "user_newpassword", "user_email", "user_touched", "user_token", "user_email_authenticated", "user_email_token", "user_email_token_expires", "user_registration", "user_newpass_time", "user_editcount", "user_password_expires"], "rowco...
dewiki_p
Pending changes
null
WITH RECURSIVE Cat AS ( SELECT page_title, page_id FROM page WHERE page_title = "Biologie" AND page_namespace = 14 UNION SELECT Subcat.page_title, Subcat.page_id FROM page AS Subcat, categorylinks, Cat WHERE Subcat.page_namespace = 14 AND cl_from = Subcat.page_id AND cl_to = Cat....
{"resultsets": [{"headers": ["actor_name", "creation_count"], "rowcount": 42}], "runningtime": "0.13"}
dewiki_p
sp2.2
null
# Simplified query to focus on blocked editors. # The page_id list can be manually compiled by looking at page id under "page information" in the Wiki web interface, # or by running Quarry query #62940 with a list of titles. select page_title as 'page title', user_name, comment_text as 'block reason' from page,...
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"], "rowcount": 50}], "runningtime": "0.12"}
enwiki
最近30日有编辑的退休者
查询在用户页挂了{{Retired}}但最近30日有编辑的用户。由于技术限制,本查询结果也包含30日内挂了{{Retired}}就再也不回维基编辑的人。
SELECT a.user_name, STR_TO_DATE(MAX(rev_timestamp), '%Y%m%d%H%i%s') last_edit_time FROM revision_userindex r INNER JOIN ( SELECT actor_id, u.user_name FROM actor a INNER JOIN ( SELECT user_id, u.user_name FROM user u INNER JOIN (SELECT REPLACE(...
{"connection_id": 134826751}
zhwiki_p
sp2.2
null
# Simplified query to focus on blocked editors. # The page_id list can be manually compiled by looking at page id under "page information" in the Wiki web interface, # or by running Quarry query #62940 with a list of titles. select page_title as 'page title', user_name, comment_text as 'block reason' from page,...
{"resultsets": [{"headers": ["cl_to"], "rowcount": 1557}], "runningtime": "112.31"}
enwiki
SQL esimerkki 1
null
select count(distinct(rev_page)) as p from wb_items_per_site, page, revision_compat where rev_page=page_id and rev_id>1799593461 and ips_site_id="fiwiki" and page_namespace=0 and page_title=concat("Q", ips_item_id) and page_latest>1799593461
{"resultsets": [{"headers": ["pl_title", "COUNT(*)"], "rowcount": 4}], "runningtime": "0.86"}
wikidatawiki_p
SQL esimerkki 2
null
select count(distinct(rev_page)) as p from (select page_id from wb_items_per_site, page where ips_site_id="fiwiki" and page_namespace=0 and page_title=concat("Q", ips_item_id) and page_latest>1799593461 ) as t, revision_compat where ...
{"resultsets": [{"headers": ["title", "count"], "rowcount": 4}], "runningtime": "0.05"}
wikidatawiki_p
Test
null
SELECT article.page_title, article.page_namespace, count(distinct actor.actor_name) as "bot users", GROUP_CONCAT(DISTINCT actor.actor_name) as "bot users named", TIMESTAMP(max(rev_timestamp)) as "last edit on page", COUNT(*) AS edits FROM revision INNER JOIN page article ON article.page_id = rev_page #A...
{"resultsets": [{"headers": ["page_title"], "rowcount": 1}], "runningtime": "0.06"}
metawiki_p
Mujeres y hombres en eswiki por mes
null
use eswiki_p; SELECT now() as 'ultima ejecucion'; SELECT if(cl_to = 'Mujeres', 'Mujeres', 'Hombres') as genero, DATE_FORMAT(rev_timestamp, '%Y-%m') as mes, count(1) as counted FROM page INNER JOIN revision ON rev_page = page_id INNER JOIN categorylinks ON cl_from = page_id WHERE rev_timestamp BETWEEN '20120101000000'...
{"resultsets": [{"headers": ["page_title", "lt_title"], "rowcount": 12}], "runningtime": "0.06"}
eswiki_p
Top idwikipedia User by Bytecounts This Month
null
select * /*sum(tdif)*/ from ( select actor_name, sum( cast(rc_new_len as int) - cast(rc_old_len as int)) tdif from recentchanges_userindex left join actor on rc_actor = actor_id where rc_timestamp >= 20230201000000 and rc_timestamp <= 20230301000000 and rc_bot = 0 and (rc_source = 'mw.new' or rc_source = 'mw.edit')...
{"resultsets": [{"headers": ["pl_title", "COUNT(*)"], "rowcount": 43}], "runningtime": "0.11"}
idwiki_p
Largest Czech Wikipedia article pages
null
SELECT page_title, page_len FROM page WHERE page_namespace = 0 ORDER BY page_len DESC LIMIT 20
{"resultsets": [{"headers": ["skin", "COUNT(*)"], "rowcount": 9}, {"headers": ["COUNT(*)"], "rowcount": 1}], "runningtime": "13.22"}
cswiki
Userspace pages of non-existent users (no talk, no subpages)
null
SELECT CONCAT('https://en.wikipedia.org/wiki/User:', p.page_title) AS URL FROM enwiki_p.page p LEFT JOIN enwiki_p.user u ON REPLACE(p.page_title, '_', ' ') = u.user_name WHERE p.page_namespace = 2 AND u.user_id IS NULL AND p.page_is_redirect = 0 AND NOT IS_IPV4(p.page_title) -- Exclude IPv4 AND NOT IS_IPV6(p.page_title...
{"resultsets": [{"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 3}], "runningtime": "0.06"}
enwiki_p
SQL esimerkki 2
null
select page_title, rev_timestamp, rev_id -- rev_user_text, -- rev_user, -- ips_site_page, -- rev_comment from (select page_id, page_title, ips_site_page from wb_items_per_site, page where ips_site_id="fiwiki" and page_namespace...
{"connection_id": 78890939}
wikidatawiki_p
Wikidata interlanguage links pointing to sh:Wikipedia
null
SELECT * FROM wb_items_per_site WHERE ips_site_id = "shwiki" AND ips_site_page LIKE "Wikipedia:%";
{"resultsets": [{"headers": ["page_title"], "rowcount": 5}], "runningtime": "0.06"}
wikidatawiki_p
List of bots by last edit
List of a user's edit times.
WITH groups AS ( SELECT ug_user, GROUP_CONCAT(ug_group) AS memberships FROM user_groups WHERE ug_group = 'bot' GROUP BY ug_user) SELECT actor.actor_name AS thành_viên, memberships AS nhóm, MAX(rev_timestamp) AS lần_sửa_đổi_cuối FROM revision LEFT JOIN actor ON (revision.rev_actor = actor.actor_id) LEF...
{"resultsets": [{"headers": ["page_title"], "rowcount": 119877}], "runningtime": "83.02"}
viwiki_p
fix Palestine categories
null
select CONCAT('* [[:تصنيف:',p1.page_title, ']]>') AS cat1 #, REPLACE(CONCAT( '[[:تصنيف:' , p1.page_title , ']]' ) , 'دولة_فلسطين' , 'فلسطين' ) AS cat2 , REPLACE(CONCAT( '[[:تصنيف:' , p1.page_title , ']]' ) , 'الأراضي_الفلسطينية' , 'فلسطين' ) AS cat2 from page AS p1 where p1.page_namespace = 14 and p1.page_title like "...
{"resultsets": [{"headers": ["cat_id", "cat_title", "cat_pages", "cat_subcats", "cat_files"], "rowcount": 50}], "runningtime": "0.09"}
arwiki_p
Wikhttps://quarry.wmcloud.org/i Loves Folklore 2023 in Ukraine Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [{"headers": ["rev_id", "rev_timestamp", "rev_actor", "page_title", "rev_len"], "rowcount": 976}], "runningtime": "0.90"}
commonswiki_p
Articles using template X
All articles in namespace 0 that are using a template X
select * from linktarget lt WHERE lt.lt_title like "%wikiedu%"
{"resultsets": [{"headers": ["\u0b87\u0ba8\u0bcd\u0ba8\u0bc2\u0bb2\u0bbf\u0ba9\u0bcd \u0bae\u0bc6\u0baf\u0bcd\u0baa\u0bcd\u0baa\u0bc1\u0baa\u0bcd\u0baa\u0ba3\u0bbf\u0baf\u0bbf\u0bb2\u0bcd \u0b88\u0b9f\u0bc1\u0baa\u0b9f\u0bcd\u0b9f\u0bcb\u0bb0\u0bcd:<br/>"], "rowcount": 0}], "runningtime": "0.14"}
enwiki_p
orphaned talks
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 89}], "runningtime": "0.60"}
enwiki_p
Userspace pages of non-existent users (no talk, no subpages)
null
SELECT CONCAT('https://en.wikipedia.org/wiki/User:', p.page_title) AS URL FROM enwiki_p.page p LEFT JOIN enwiki_p.user u ON REPLACE(p.page_title, '_', ' ') = u.user_name WHERE p.page_namespace = 2 AND u.user_id IS NULL AND p.page_is_redirect = 0 AND NOT IS_IPV4(p.page_title) -- Exclude IPv4 AND NOT IS_IPV6(p.page_title...
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"], "rowcount": 24}], "runningtime": "0.71"}
enwiki_p
User edit count between two dates
null
SELECT count(*), ac.actor_name FROM revision_userindex rv JOIN actor ac ON rv.rev_actor = ac.actor_id #AND rv.rev_timestamp >= '20210308000000' AND rv.rev_timestamp > '20210310000000' WHERE ac.actor_name like '%Soni%' GROUP BY rv.rev_actor LIMIT 10
{"resultsets": [{"headers": ["page_title"], "rowcount": 2}], "runningtime": "75.15"}
enwiki
All WikiEd students by number of edits since program ended
- Assuming last edit on the Program page was "End of course", Edits by student since end of course
SELECT count(distinct rv2.rev_id) as edits, pl.pl_title as student, CONCAT('https://en.wikipedia.org/wiki/User:',pl.pl_title) as student_url, p3.page_title AS program_name, lg.log_timestamp as program_start_date, rv1.rev_timestamp as program_end_date, TIMESTAMPDIFF(DAY,lg.log_timestamp,rv1.rev...
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 88}], "runningtime": "0.45"}
enwiki
All WikiEd students by number of edits since program ended #3
Assuming first edit on Program page was "start of course", edits by student since 10 months after 'start of course'
SELECT count(distinct rv2.rev_id) as edits, pl.pl_title as student, CONCAT('https://en.wikipedia.org/wiki/User:',pl.pl_title) as student_url, p3.page_title AS program_name, lg.log_timestamp as program_start_date, DATE_FORMAT(DATE_ADD(lg.log_timestamp, interval 10 month),'%Y%m%d%s0000') as program_...
{"resultsets": [{"headers": ["time", "user", "namespace", "page", "comment"], "rowcount": 0}], "runningtime": "0.06"}
enwiki
All WikiEd students by number of edits since program ended #2
Assuming first edit on Program page was "start of course", edits by student since 4 months after 'start of course'
SELECT count(distinct rv2.rev_id) as edits, pl.pl_title as student, CONCAT('https://en.wikipedia.org/wiki/User:',pl.pl_title) as student_url, p3.page_title AS program_name, lg.log_timestamp as program_start_date, DATE_FORMAT(DATE_ADD(lg.log_timestamp, interval 4 month),'%Y%m%d%s0000') as program_e...
{"resultsets": [{"headers": ["Reviewer", "Redirect Reviews"], "rowcount": 10}], "runningtime": "5.59"}
enwiki
Possibly orphaned talk subpages (parent redirects)
Now changed to check non-article talk namespaces (odd ns except 1)
SELECT Ps.page_namespace AS CSns, Ps.page_title AS CurrentSubpage, Ps.page_namespace AS SSns, CONCAT(Pp.page_title,REGEXP_SUBSTR(Ps.page_title, "\/.*")) AS SuggestedSubpage, rd_namespace AS RFns, Pp.page_title AS RedirectFrom, Ps.page_namespace AS RTns, rd_title AS RedirectTo FROM page Ps JOIN page...
{"resultsets": [{"headers": ["actor_name", "page_title", "COUNT(*)"], "rowcount": 50}], "runningtime": "0.94"}
enwiki_p
Wikhttps://quarry.wmcloud.org/i Loves Folklore 2023 in Ukraine Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [], "runningtime": "0.03"}
commonswiki_p
Latest revision id
null
SELECT max(rev_id) FROM revision
{"resultsets": [{"headers": ["Reviewer", "Article Reviews"], "rowcount": 10}], "runningtime": "2.45"}
enwiki_p
Articles created by CX in siwiki in 2021
null
-- When appropriate, change 'contenttranslation' to 'sectiontranslation' set @cx_edit_tag = ( select ctd_id from change_tag_def where ctd_name = 'contenttranslation' ); SELECT rev_timestamp, actor_name, page_title, page_namespace, page_id, MAX(ct_rev_id) FROM `cha...
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 31}], "runningtime": "1.04"}
gdwiki_p
hewiki most prolific translators
null
use gdwiki_p; SELECT rev_actor, actor_name, count(revision.rev_id) as articles_created FROM change_tag, actor, revision WHERE revision.rev_parent_id = 0 AND ct_tag_id = (select ctd_id from change_tag_def where ctd_name = 'contenttranslation') AND rev_id = ct_rev_id AND rev_actor = actor_id GROUP BY rev_acto...
{"resultsets": [{"headers": ["page_title"], "rowcount": 5}], "runningtime": "0.06"}
gdwiki_p
Tewiki Date-wise pages published from Content translation
null
use gdwiki_p; select substr(rev_timestamp, 1, 8) as Datee, count(substr(rev_timestamp, 1, 8)) as Translated_articles from change_tag, change_tag_def, revision, page where ct_tag_id = ctd_id and rev_id = ct_rev_id and page_id = rev_page and page_namespace = 0 and page_is_redirect = 0 and ctd_name...
{"resultsets": [{"headers": ["page_title"], "rowcount": 9}], "runningtime": "0.18"}
gdwiki_p
Deletion rates of CX and non-CX articles for a wiki
For one wiki, shows how many articles were created using Content Translation (CX articles) and how frequently they were deleted, compared to articles created using other methods (non-CX articles).
SET @start_time = '20140101'; -- 1 Jan 2020 SET @end_time = '20230101'; -- 1 Jan 2021 SET @cx_tag_id = ( SELECT ctd_id FROM change_tag_def WHERE ctd_name = 'contenttranslation' ); WITH nondeleted_new_articles AS ( SELECT SUM(IF(ct_tag_id = @cx_tag_id, 1, 0)) AS cx, SUM(IF(ct_tag_id IS N...
{"resultsets": [{"headers": ["user_name", "page_len", "page_id"], "rowcount": 10}], "runningtime": "1.24"}
gdwiki_p
ويكيبيديا:إحصاءات الشهر
null
# https://ar.wikipedia.org/w/index.php?title=%D9%88%D9%8A%D9%83%D9%8A%D8%A8%D9%8A%D8%AF%D9%8A%D8%A7:%D8%A5%D8%AD%D8%B5%D8%A7%D8%A1%D8%A7%D8%AA_%D8%A7%D9%84%D8%B4%D9%87%D8%B1&oldid=59981404 SET @start_date = '20230301000000'; SET @end_date = '20230331235959'; # عدد التعديلات يشمل عدد التعديلات المخفية من خلال الوصف او...
{"resultsets": [{"headers": ["page_title"], "rowcount": 83}], "runningtime": "0.56"}
arwiki_p
Subpages of GLAM/Newsletter, with full URLs
null
SELECT concat("https://outreach.wikimedia.org/wiki/", page_title) FROM page WHERE page_namespace = 0 AND page_title LIKE 'GLAM/Newsletter%'
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 31}], "runningtime": "0.33"}
outreachwiki_p
%before_1%
null
SELECT CONCAT("Category:",cat_title,"") FROM category #FROM category AS page #WHERE page_namespace = 14 #AND page_is_redirect =0 WHERE cat_title LIKE "%Iceland%" #AND (page_title LIKE "%peopel%" OR page_title LIKE "%Peopel%") LIMIT 9999;
{"resultsets": [{"headers": ["page_title", "rev_id", "comment_text"], "rowcount": 0}], "runningtime": "0.04"}
enwiki_p
Comment search (rd)
null
SET STATEMENT max_statement_time = 1200 FOR SELECT rev_id, actor_name, page_title, comment_text FROM revision_userindex AS revision INNER JOIN page ON revision.rev_page = page.page_id INNER JOIN actor_revision AS actor ON revision.rev_actor = actor.actor_id INNER JOIN comment_revision AS comment ON revi...
{"resultsets": [{"headers": ["lt_title"], "rowcount": 46}], "runningtime": "16.50"}
enwiki
متوسط عدد التعديلات في اليوم حسب الشهر لآخر سنه
null
/* SELECT COUNT(rev_id) AS edit_count, DATE(rev_timestamp) AS day FROM revision WHERE rev_actor IN (SELECT actor_id FROM actor WHERE actor_name LIKE 'LokasBot') GROUP BY DATE(rev_timestamp); */ /* SELECT COUNT(rev_id) / COUNT(DISTINCT DATE(rev_timestamp)) AS avg_edit_per_day FROM revision WHERE rev_actor IN (SELECT act...
{"resultsets": [{"headers": ["result"], "rowcount": 76}], "runningtime": "0.12"}
arwiki_p
بوت:صيانة ، إضافة قالب الحماية
null
select distinct page.page_title,page.page_namespace,page.page_is_redirect from page_restrictions inner join page on page_restrictions.pr_page = page.page_id where page.page_namespace in (0) and pr_page not in ( select page.page_id from templatelinks inner join page on templatelinks.tl_from = page.page_id inner join ...
{"resultsets": [{"headers": ["result"], "rowcount": 1}], "runningtime": "0.06"}
arwiki_p
بوت:صيانة ، إزالة قالب الحماية
null
select page.page_title,page.page_namespace from templatelinks inner join page on templatelinks.tl_from = page.page_id inner join linktarget on templatelinks.tl_target_id = linktarget.lt_id where lt_namespace = 10 and lt_title in ( "محمية", "protected", "حماية_خاصة", "حماية_نزاع",...
{"resultsets": [{"headers": ["page_title"], "rowcount": 2}], "runningtime": "57.99"}
arwiki_p
最长的电子游戏条目 (zhwiki)
null
WITH pages_vg AS ( WITH pages_vg_talk AS ( SELECT page.page_namespace, page.page_title FROM page JOIN categorylinks ON cl_to IN ( '典范级电子游戏条目', '优良级电子游戏条目', '乙级电子游戏条目', '丙级电子游戏条目', '初级电子游戏条目', '小作品级电子游戏条目', '未评级电子游戏条目' ) ...
{"resultsets": [{"headers": ["rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1"], "rowcount": 0}], "runningtime": "0.07"}
zhwiki_p
最短的电子游戏条目 (zhwiki)
null
WITH pages_vg AS ( WITH pages_vg_talk AS ( SELECT page.page_namespace, page.page_title FROM page JOIN categorylinks ON cl_to IN ( '极高重要度电子游戏条目', '高重要度电子游戏条目', '中重要度电子游戏条目', '低重要度电子游戏条目', '未知重要度电子游戏条目' ) AND cl_type = 'page' AND ...
{"connection_id": 136595165}
zhwiki_p
ReferenceExpander edits by month
Counts of edit summaries containing "ReferenceExpander" (case-sensitive), grouped by month. For [[WP:RAQ#ReferenceExpander]] circa 1 Apr 2023.
SELECT LEFT(rev_timestamp, 6), COUNT(*) FROM revision JOIN comment_revision ON comment_id = rev_comment_id WHERE comment_text LIKE '%ReferenceExpander%' AND rev_timestamp BETWEEN '2020' AND '2021' -- any range longer than about a year does a full table scan GROUP BY LEFT(rev_timestamp, 6) UNION SELECT LEFT(rev_timest...
{"resultsets": [{"headers": ["user_name", "user_id", "actor_id"], "rowcount": 1}], "runningtime": "0.06"}
enwiki_p
International Roma Day Edit-a-thon pages
null
select iwl_title from page, iwlinks where iwl_from=page_id and iwl_prefix="d" and page_title like "International_Roma_Day_Edit-a-thon/Structure%" and page_namespace=0 GROUP BY iwl_title
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 32}], "runningtime": "5.65"}
metawiki_p
enwiki random cat
null
#USE commonswiki_p; SELECT CONCAT ("Category talk:",page_title,"") #LEFT JOIN page as page ON page_id=cat_id FROM page AS page WHERE page_namespace =14 AND page_len >0 AND page_is_redirect = 0 #AND page_title LIKE "K%" #cat_title LIKE '%by_quantity%' #AND cat_title NOT LIKE "Images_from_the_Geograph_British_Isles_p...
{"resultsets": [{"headers": ["CONCAT(\"# [[\",p.page_title,\"]]\")", "actor_name", "log_action", "log_timestamp"], "rowcount": 459}], "runningtime": "5.39"}
enwiki_p
ReferenceExpander edits, 2023
Edits in 2023 with summaries containing "ReferenceExpander" (case-sensitive). July-December 2022 edits in query 72745. Summary by month in query 72740; compare query 72737. For [[WP:RAQ#ReferenceExpander]] circa 1 Apr 2023.
SELECT r1.rev_id, r1.rev_timestamp, actor_name, page_namespace, page_title, r1.rev_len - COALESCE(r2.rev_len, 0) AS delta, comment_text FROM revision AS r1 JOIN comment_revision ON comment_id = r1.rev_comment_id JOIN actor_revision ON actor_id = r1.rev_actor JOIN page ON page_id = r1....
{"resultsets": [{"headers": ["pl_title", "COUNT(*)"], "rowcount": 0}], "runningtime": "0.79"}
enwiki_p
ReferenceExpander edits, 2nd half 2022
Edits from July-December 2022 with summaries containing "ReferenceExpander" (case-sensitive). 2023 edits in query 72741. Summary by month in query 72740; compare query 72737. For [[WP:RAQ#ReferenceExpander]] circa 1 Apr 2023.
SELECT r1.rev_id, r1.rev_timestamp, actor_name, page_namespace, page_title, r1.rev_len - COALESCE(r2.rev_len, 0) AS delta, comment_text FROM revision AS r1 JOIN comment_revision ON comment_id = r1.rev_comment_id JOIN actor_revision ON actor_id = r1.rev_actor JOIN page ON page_id = r1....
{"connection_id": 136843497}
enwiki_p
Wikhttps://quarry.wmcloud.org/i Loves Folklore 2023 in Ukraine Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [{"headers": ["page_title"], "rowcount": 392}], "runningtime": "2.36"}
commonswiki_p
Articles with no internal wikilink such as [[Wikipedia]] (ckbwiki)
This query retrieves all Central Kurdish Wikipedia articles that have no [[internal wikilink]]. At least one internal wikilink is required to count articles in the statistics. For more information, go to https://www.mediawiki.org/wiki/Manual:Article_count
USE ckbwiki_p; SELECT page_title FROM page WHERE page_namespace = 0 AND page_is_redirect = 0 AND NOT EXISTS ( SELECT * FROM pagelinks WHERE pl_from = page_id AND pl_namespace = 0 );
{"connection_id": 80425567}
ckbwiki_p
Article page protections by type on fr.wiki 21-22
null
#SELECT COUNT(DISTINCT log_title) FROM logging SELECT CASE WHEN log_params LIKE '%edit=autoconfirmed%' THEN 'edit_autoconfirmed' WHEN log_params LIKE '%edit=editextendedsemiprotected%' THEN 'edit_extendedconfirmed' WHEN log_params LIKE '%edit=sysop%' THEN 'edit_sysop' WHEN log_params LIKE '%cr...
{"resultsets": [{"headers": ["page_title"], "rowcount": 384}], "runningtime": "0.63"}
frwiki
Vandalismebestrijding nlwiki, backlog 595
Vandalismebestrijding: 595 achterstand
# anonymous edits totals SELECT CASE rc_patrolled WHEN 0 THEN 'unpatrolled' WHEN 1 THEN 'manually patrolled' WHEN 2 THEN 'autopatrolled' END AS rc_patrolled, COUNT(*) AS 'count' FROM recentchanges, actor WHERE rc_actor=actor_id AND actor_user IS NULL GROUP BY rc_patrolled UNION SELECT 'total...
{"resultsets": [{"headers": ["id", "language", "text"], "rowcount": 6252}], "runningtime": "288.05"}
nlwiki_p
orphaned talks
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["page_title"], "rowcount": 26}], "runningtime": "0.11"}
enwiki_p
Deletion rates of CX and non-CX articles for a wiki
For one wiki, shows how many articles were created using Content Translation (CX articles) and how frequently they were deleted, compared to articles created using other methods (non-CX articles).
SET @start_time = '20230101'; -- 1 Jan 2020 SET @end_time = '20230404'; -- 1 Jan 2021 SET @cx_tag_id = ( SELECT ctd_id FROM change_tag_def WHERE ctd_name = 'contenttranslation' ); WITH nondeleted_new_articles AS ( SELECT SUM(IF(ct_tag_id = @cx_tag_id, 1, 0)) AS cx, SUM(IF(ct_tag_id IS N...
{"resultsets": [{"headers": ["ar_id", "ar_namespace", "ar_title", "ar_timestamp", "ar_minor_edit", "ar_page_id"], "rowcount": 4775}], "runningtime": "29.81"}
gdwiki_p
hewiki most prolific translators
null
use gdwiki_p; SELECT rev_actor, actor_name, count(revision.rev_id) as articles_created FROM change_tag, actor, revision WHERE revision.rev_parent_id = 0 AND ct_tag_id = (select ctd_id from change_tag_def where ctd_name = 'contenttranslation') AND rev_id = ct_rev_id AND rev_actor = actor_id GROUP BY rev_acto...
{"resultsets": [{"headers": ["#", "Usuario/a", "Total"], "rowcount": 100}], "runningtime": "0.34"}
gdwiki_p
Get Category Items Without Descriptions in English
null
SELECT wbit_item_id AS id, wby_name AS type, wbxl_language AS language, wbx_text AS text FROM wbt_item_terms LEFT JOIN wbt_term_in_lang ON wbit_term_in_lang_id = wbtl_id LEFT JOIN wbt_type ON wbtl_type_id = wby_id LEFT JOIN wbt_text_in_l...
{"resultsets": [{"headers": ["log_id", "log_timestamp", "user", "log_title", "log_params", "summary"], "rowcount": 100}], "runningtime": "2.06"}
wikidatawiki_p
Tewiki Date-wise pages published from Content translation
null
use gdwiki_p; select substr(rev_timestamp, 1, 8) as Datee, count(substr(rev_timestamp, 1, 8)) as Translated_articles from change_tag, change_tag_def, revision, page where ct_tag_id = ctd_id and rev_id = ct_rev_id and page_id = rev_page and page_namespace = 0 and page_is_redirect = 0 and ctd_name...
{"resultsets": [{"headers": ["concat(\"Module:\",page_title)", "page_len"], "rowcount": 358}], "runningtime": "17.50"}
gdwiki_p
Deletion Ratios for one wiki during 2020
Example data for task https://phabricator.wikimedia.org/T246324. Shows ratio of main namespace articles that were created using Content Translation and not using Content Translation and subsequently deleted. This sample works for the Hungarian Wikipedia (huwiki) for 2019.
set @ct_tag_id = ( select ctd_id from change_tag_def where ctd_name = 'contenttranslation' ); set @created_total = ( select count(rev_id) from page, revision where page_id = rev_page and page_namespace = 0 and rev_timestamp like '2021%' and rev_parent_id = 0 ); set...
{"resultsets": [{"headers": ["User page", "User edit count", "Page last edited", "Is new?"], "rowcount": 774}], "runningtime": "27.69"}
gdwiki_p
Wikhttps://quarry.wmcloud.org/i Loves Folklore 2023 in Ukraine Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [{"headers": ["page_title", "pl_title"], "rowcount": 678}], "runningtime": "17.64"}
commonswiki_p
Wiki Loves Folklore 2023 Participants
null
SELECT A.actor_name, COUNT(1) as files FROM commonswiki_p.image I JOIN commonswiki_p.page P ON I.img_name = P.page_title JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id WHERE P.page_namespace = 6 AND CL.cl_to = "Images_from_Wiki_Loves_Folklore_202...
{"resultsets": [{"headers": ["total", "accept", "decline", "reject", "accept %", "decline %", "reject %"], "rowcount": 1}], "runningtime": "12.85"}
commonswiki_p
images uploaded by an user
Own work files uploaded by user
SELECT page_title FROM revision_userindex JOIN actor_revision ON rev_actor=actor_id JOIN page ON rev_page=page_id JOIN templatelinks ON tl_from=page_id JOIN linktarget ON tl_target_id=lt_id WHERE page_namespace=6 AND rev_parent_id = 0 AND lt_title = 'Own' AND actor_name = 'Antti T. Leppänen'
{"resultsets": [{"headers": ["page_title", "rev_timestamp"], "rowcount": 0}], "runningtime": "0.45"}
commonswiki
Select items without claims
~2.107 sec per 1000 items from subquery
SELECT REPLACE(page_title, 'Q', '') AS item_id FROM page INNER JOIN (SELECT DISTINCT pp_page FROM page_props WHERE pp_propname = 'wb-claims' AND pp_value = 0) as empty_page ON page.page_id = empty_page.pp_page;
{"resultsets": [{"headers": ["page_title", "rev_timestamp", "page_latest", "count", "pa_class"], "rowcount": 117}], "runningtime": "0.53"}
wikidatawiki_p
Editcount of admins after receiving adminship
null
SELECT log_timestamp, log_title from logging #NOTE: Timestamp may not be last time adminship granted WHERE logging.log_type="rights" AND logging.log_action="rights" AND logging.log_params REGEXP 'newgroups".*"sysop"' GROUP BY log_title
{"resultsets": [{"headers": ["el_from", "page_title", "el_to"], "rowcount": 424}], "runningtime": "52.69"}
enwiki
Editcount of admins since becoming admins
null
WITH adt as ( SELECT log_timestamp,log_title from logging WHERE logging.log_type = "rights" AND logging.log_action = "rights" /* AND log_timestamp > 20180000000000 */ AND logging.log_params REGEXP 'newgroups".*"sysop"' GROUP BY log_title ), adt_with_revs as ( SELECT rev_timesta...
{"resultsets": [{"headers": ["cl_from", "cl_to", "cl_sortkey", "cl_timestamp", "cl_sortkey_prefix", "cl_collation", "cl_type", "page_id", "page_namespace", "page_title", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"],...
enwiki
Userspace pages of non-existent users (no talk, no subpages)
null
SELECT CONCAT('https://en.wikipedia.org/wiki/User:', p.page_title) AS URL FROM enwiki_p.page p LEFT JOIN enwiki_p.user u ON REPLACE(p.page_title, '_', ' ') = u.user_name WHERE p.page_namespace = 2 AND u.user_id IS NULL AND p.page_is_redirect = 0 AND NOT IS_IPV4(p.page_title) -- Exclude IPv4 AND NOT IS_IPV6(p.page_title...
{"resultsets": [{"headers": ["page_title"], "rowcount": 20502}], "runningtime": "17.34"}
enwiki_p
Orphaned talk pages
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["page_title"], "rowcount": 0}], "runningtime": "0.10"}
enwiki_p
Locked WMF accounts
All WMF accounts that have ever been globally locked
select gu_id as id, gu_name as name, gu_home_db as home, gu_registration as registration from globaluser where gu_name like "%(WMF)" and gu_locked<>0 order by gu_name limit 999
{"resultsets": [{"headers": ["page_title"], "rowcount": 20502}], "runningtime": "17.90"}
centralauth
IPv6 /64 subnets w/most edits
IPv6 addresses with the most live edits to enwiki, grouped by /64 subnets. While this is the usual size of a block of addresses assigned to an individual (see e.g. [[WP:/64]]), those with the highest edit counts are likely widely dynamic. For [[WP:VPM#Interesting question about edit counts]] circa 27 June 2022. (The...
SELECT COUNT(*), CONCAT(SUBSTRING_INDEX(actor_name, ':', 4), '::/64') AS subnet FROM revision_userindex JOIN actor_revision ON rev_actor = actor_id WHERE actor_user IS NULL AND actor_name LIKE '%:%' GROUP BY subnet HAVING COUNT(*) >= 40000 ORDER BY COUNT(*) DESC;
{"resultsets": [{"headers": ["Page title", "Namespace"], "rowcount": 59020}], "runningtime": "42.37"}
enwiki_p
Possible BLPPROD candidates
To do: -Add timestamps for created/last edited -Create crawler bot to filter out articles that have ref sections (and post results to a wiki user page)
SELECT CONCAT('https://en.wikipedia.org/wiki/', p.page_title) AS 'Page', COUNT(el.el_id) AS 'External link count', MAX(p.page_len) AS 'Length'-- , TIMESTAMP(MIN(r.rev_timestamp)) AS 'Created' FROM page p LEFT JOIN externallinks el ON p.page_id = el.el_from -- INNER JOIN revision_userindex r ON p.page_id = r.rev_page WH...
{"connection_id": 138674276}
enwiki_p
Living people articles without WP Biography tag
playing around with the query scheme to see what effect things have on performance; a bit slower with the redundant sub-SELECT, but not much. Repeating to see whether there's some sort of schema optimization going on. Now producing wiki markup so this can be easily cut-and-pasted into WP Now uses LEFT JOIN so I can d...
SELECT CONCAT("* [[",article.page_title, "]]") -- , talk.page_id AS talk_page_id FROM page AS article LEFT JOIN page AS talk ON talk.page_title = article.page_title AND talk.page_namespace = 1 AND talk.page_is_redirect = 0 WHERE -- article.page_id % 10 = 2 article.page_namespace = 0 AND article.page_is_red...
{"resultsets": [{"headers": ["ns", "title", "title length", "size", "hello"], "rowcount": 1}], "runningtime": "0.08"}
enwiki_p
sp2.12
null
# Simplified query to focus on blocked editors. # The page_id list can be manually compiled by looking at page id under "page information" in the Wiki web interface, # or by running Quarry query #62940 with a list of titles. select page_title as 'page title', user_name, comment_text as 'block reason' from page,...
{"resultsets": [{"headers": ["ns", "title", "title length", "size", "count"], "rowcount": 10}], "runningtime": "15.22"}
enwiki
Get articles without listas that have a given keyword in their page name
As title. used primarily for getting people with a surname
SELECT page.page_title FROM page INNER JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE categorylinks.cl_to = "Biography_articles_without_listas_parameter" AND page.page_title LIKE "%Robinson%"
{"resultsets": [{"headers": ["rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1"], "rowcount": 2}, {"headers": ["rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev...
enwiki
Orphaned talk pages
null
SELECT page_namespace, page_id, page_title, page_is_redirect, page_len ...
{"resultsets": [{"headers": ["CONCAT('* [[', p.page_title, ']]')"], "rowcount": 0}], "runningtime": "0.05"}
enwiki_p
Query
null
SELECT page_title FROM page, redirect WHERE page_id = rd_from AND rd_interwiki = '' AND page_namespace = 0 AND NOT EXISTS ( SELECT 1 FROM page WHERE page_title = rd_title AND page_namespace = rd_namespace )
{"resultsets": [{"headers": ["CONCAT('* [[', p.page_title, ']]')"], "rowcount": 0}], "runningtime": "0.05"}
enwiki_p