title stringlengths 1 212 | description stringlengths 1 4.39k ⌀ | query stringlengths 1 65.5k ⌀ | extra_info stringlengths 18 31.6k | wikidb stringlengths 4 26 ⌀ |
|---|---|---|---|---|
Q2DE | null | select year(ru.rev_timestamp) y, month(ru.rev_timestamp) m, day(ru.rev_timestamp) d, hour(ru.rev_timestamp) h, count(*) c from revision_userindex ru
join actor_revision a on a.actor_id = ru.rev_actor
join user u on a.actor_user = u.user_id
where YEAR(ru.rev_timestamp) >= 2018 and u.user_name not in (select ug_user from... | {"runningtime": "0.20", "resultsets": [{"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}]} | dewiki |
Q5PL | null | select year(ru.rev_timestamp) y, month(ru.rev_timestamp) m, day(ru.rev_timestamp) d, hour(ru.rev_timestamp) h, count(*) c from revision_userindex ru
join actor_revision a on a.actor_id = ru.rev_actor
join user u on a.actor_user = u.user_id
where YEAR(ru.rev_timestamp) >= 2018 and u.user_name not in (select ug_user from... | {"runningtime": "2.92", "resultsets": [{"rowcount": 260, "headers": ["editor", "accepts", "recent_edits"]}]} | plwiki |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('#[[:File:', page_title, ']]') AS wikitext
FROM categorylinks
JOIN templatelinks ON tl_from = cl_from
JOIN page ON page_id = cl_from
WHERE cl_to LIKE 'All\_media\_needing\_categories\_as\_of%'
AND cl_type = 'file' AND page_namespace = 6
AND tl_namespace = 10 AND tl_title = 'Cs'
ORDER BY page_title;
/*
SEL... | {"runningtime": "68.89", "resultsets": [{"rowcount": 31, "headers": ["date", "reviews", "accepts", "declines", "rejects"]}]} | commonswiki_p |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('#[[:File:', page_title, ']]') AS wikitext
FROM categorylinks
JOIN templatelinks ON tl_from = cl_from
JOIN page ON page_id = cl_from
WHERE cl_to LIKE 'All\_media\_needing\_categories\_as\_of%'
AND cl_type = 'file' AND page_namespace = 6
AND tl_namespace = 10 AND tl_title = 'Cs'
ORDER BY page_title;
/*
SEL... | {"resultsets": [{"rowcount": 35, "headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %"]}], "runningtime": "18.04"} | commonswiki_p |
fawiki 1Lib1Ref contribs of 2021 | null | SELECT
actor_name,
COUNT(rev_id) AS cnt
FROM revision_userindex
JOIN comment
ON rev_comment_id = comment_id
AND (
comment_text LIKE '%#1Lib1Ref%'
OR comment_text LIKE '%#1Lib1RefIran%'
)
JOIN actor
ON rev_actor = actor_id
JOIN page
ON rev_page = page_id
AND page_namespace = 0
WHERE
rev_id > 31... | {"resultsets": [{"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}], "runningtime": "0.29"} | fawiki_p |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('#[[:File:', page_title, ']]') AS wikitext
FROM categorylinks
JOIN templatelinks ON tl_from = cl_from
JOIN page ON page_id = cl_from
WHERE cl_to LIKE 'All\_media\_needing\_categories\_as\_of%'
AND cl_type = 'file' AND page_namespace = 6
AND tl_namespace = 10 AND tl_title = 'Cs'
ORDER BY page_title;
/*
SEL... | {"resultsets": [{"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}, {"rowcount": 1, "headers": ["count(*)"]}], "runningtime": "0.28"} | commonswiki_p |
Reviewer stats (bnwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use bnwiki_p;
SELECT
user_name user,
count(*) as review_cnt
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
#AND log_timestamp > CONCAT( YEAR( DATE_SUB( NOW(), INTERVAL... | {"resultsets": [], "runningtime": "0.03"} | bnwiki_p |
top rollbacker | null | SELECT actor_name as user,
COUNT(*) as cnt
FROM revision
JOIN change_tag
ON rev_id = ct_rev_id
JOIN actor
ON actor_id = rev_actor
WHERE ct_tag_id =
(SELECT ctd_id FROM change_tag_def
WHERE ctd_name = 'mw-rollback')
GROUP BY user
ORDER BY cnt DESC
LIMIT 100; | {"resultsets": [{"rowcount": 377, "headers": ["actor_name", "count(rev_actor)"]}], "runningtime": "10.33"} | bnwiki |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('#[[:File:', page_title, ']]') AS wikitext
FROM categorylinks
JOIN templatelinks ON tl_from = cl_from
JOIN page ON page_id = cl_from
WHERE cl_to LIKE 'All\_media\_needing\_categories\_as\_of%'
AND cl_type = 'file' AND page_namespace = 6
AND tl_namespace = 10 AND tl_title = 'Cs'
ORDER BY page_title;
/*
SEL... | {"runningtime": "9.06", "resultsets": [{"rowcount": 730, "headers": ["page_title"]}]} | commonswiki_p |
List of users who thanked a user | null | SELECT actor_name as sender,
log_title as receiver,
logging_logindex.*,
actor_logging.*
FROM logging_logindex
JOIN actor_logging ON actor_id = log_actor
WHERE log_action = 'thank'
AND log_title = 'Vieque'
ORDER BY log_timestamp DESC | {"runningtime": "0.07", "resultsets": [{"rowcount": 1, "headers": ["fpp_page_id", "fpp_quality", "fpp_rev_id", "fpp_pending_since"]}]} | enwiki |
zhwiki: LTA redirects | null | SELECT page_title
FROM page
WHERE page_title LIKE "LTA:%"
ORDER BY page_title | {"resultsets": [{"rowcount": 500, "headers": ["user_name", "length(user_name)", "user_editcount"]}], "runningtime": "1.38"} | zhwiki_p |
Highest edit count (**wiki, last 30 days) | null | SET @rev = (SELECT MIN(rev_id)
FROM revision
WHERE rev_timestamp > DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -90 DAY), "%Y%m%d%H%i%s"));
SELECT COUNT(*) AS 'Edits',
actor_name AS `User`,
ug_group AS `Rights`
FROM revision_userindex
JOIN actor_revision ON rev_actor = actor_id
LEFT JOIN user_gr... | {"runningtime": "30.38", "resultsets": [{"rowcount": 1129, "headers": ["page_title", "page_touched"]}]} | enwiki_p |
List of Wikilinks from a page and its sub pages | null | select pl_title,page_title from pagelinks,page
#join page on page_id=pl_from
where page_id=pl_from
and page_title like "మీకు_తెలుసా?_భండారము%"
and page_namespace = 4
and pl_namespace = 0
#and catl.cl_type = "page"
#group by p.page_id
#order by pl_title
| {"connection_id": 1081557541} | tewiki_p |
proofing of the unique taxon links | null | SELECT page_title
FROM page
WHERE page_title LIKE '%(antlion)'
GROUP BY page_title
ORDER BY RAND()
LIMIT 99; | {"resultsets": [{"rowcount": 17, "headers": ["page_title", "user"]}], "runningtime": "7.47"} | enwiki_p |
All female editors on German Wikipedia with Wikimail set, sorted by user_id | null | USE dewiki_p;
SELECT
up_user,
user.user_editcount,
user.user_name,
edits_after
FROM user_properties
JOIN user ON user.user_id = user_properties.up_user
INNER JOIN (SELECT
rev_user_text AS edit_username,
COUNT(rev_id) AS edits_after
FROM revision_compat
WHERE rev_ti... | {"runningtime": "15.30", "resultsets": [{"headers": ["page_title"], "rowcount": 24}]} | dewiki |
All female editors on German Wikipedia with Wikimail set, sorted by user_id | null | USE dewiki_p;
SELECT
up_user,
user.user_editcount,
user.user_name,
edits_after
FROM user_properties
JOIN user ON user.user_id = user_properties.up_user
INNER JOIN (SELECT
rev_user_text AS edit_username,
COUNT(rev_id) AS edits_after
FROM revision_compat
WHERE rev_ti... | {"runningtime": "15.41", "resultsets": [{"headers": ["page_title"], "rowcount": 87}]} | dewiki |
Highest Edit Count - Pt wiki | null | SET @rev = (SELECT MIN(rev_id)
FROM revision
WHERE rev_timestamp > DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -150 DAY), "%Y%m%d%H%i%s"));
SELECT COUNT(*) AS 'Edits',
actor_name AS `User`
FROM revision_userindex
JOIN actor_revision ON rev_actor = actor_id
WHERE rev_id >= @rev
GROUP BY `User`
ORDER... | {"runningtime": "9.34", "resultsets": [{"headers": ["ar_id", "ar_namespace", "ar_title", "ar_timestamp", "ar_page_id"], "rowcount": 3123}]} | ptwiki_p |
MOS redirect check | idea by User:Tamzin | use enwiki_p;
#First query: "WP:MOS:" redirects where no "MOS:" redirect exists
select page_title, rd_title, rd_namespace from page join redirect on page_id = rd_from
where page_is_redirect = 1 and page_namespace = 4 and page_title like "MOS:%"
and page_title not in (select page_title from page where page_namespace = 0... | {"runningtime": "0.09", "resultsets": [{"headers": ["img_name", "License"], "rowcount": 1}]} | enwiki |
nlwiki Anonymous edits rc_patrolled summary | null | # 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... | {"runningtime": "14.03", "resultsets": [{"headers": ["page_title"], "rowcount": 69}]} | nlwiki |
category | null | USE bnwiki_p;
SELECT CONCAT('[[:বিষয়শ্রেণী:', page_title, '|' , page_title, ']]') AS page_title
FROM page
WHERE page_namespace = 14 and page_is_redirect = 0
AND page_title REGEXP '(ইসলাম)'
AND page_title NOT REGEXP '(Wikipedia)'
#LIMIT 1000
; | {"runningtime": "82.26", "resultsets": [{"headers": ["up_user", "user_editcount", "user_name"], "rowcount": 275}]} | bnwiki |
Reply Tool usage: last 90d, en.wiki | null | select actor_name, count(*) as total
from (
select ct.ct_id, ct.ct_rev_id, actor_user, actor_name
from enwiki_p.change_tag ct
inner join enwiki_p.revision_actor_temp rat
on ct.ct_rev_id = rat.revactor_rev
inner join enwiki_p.actor act
on rat.revactor_actor = act.actor_id
inner join enwiki_p.change_tag_def
on ct_tag_i... | {"runningtime": "15.68", "resultsets": [{"headers": ["page_title"], "rowcount": 10}]} | enwiki_p |
Files on uk.wiki GFDL pr uploader | null | #USE ukwiki_p;
#SELECT CONCAT('# [[:File:', REPLACE(REPLACE(p.page_title, '"', '**DOUBLEQUOTE**'), '_', ' '), ']]') FROM page p
SELECT CONCAT('[[User:', actor_name, ']]') as Uploader, CONCAT('[[:File:', p.page_title, ']]') as file
FROM page p
INNER JOIN categorylinks c1 ON p.page_id = c1.cl_from
#LEFT JOIN imagelinks i... | {"runningtime": "1.36", "resultsets": [{"headers": ["page_title"], "rowcount": 730}]} | ukwiki_p |
Indonesian Wikipedia Pages | null | select select
page_id,i
page_title,
from page
order by page_id
limit 100; | {"connection_id": 4665260} | idwiki |
Edits and users with certain edit summary (svwiki, diffedit) | Edits on Swedish Wikipedia made using https://meta.wikimedia.org/wiki/User:Jon_Harald_S%C3%B8by/diffedit | SELECT page_title, actor_name, r2.rev_timestamp, comment_text
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
LEFT JOIN revision r2 ON r1.rev_parent_id = r2.rev_id
WHERE comment_text LIK... | {"runningtime": "9.28", "resultsets": [{"headers": ["ar_id", "ar_namespace", "ar_title", "ar_timestamp", "ar_page_id"], "rowcount": 3128}]} | svwiki_p |
zhwiki: links count for redirects from wp to wpj | null | SELECT pl_namespace, pl_title, COUNT(pl_from) AS `count`
FROM pagelinks
LEFT JOIN (
SELECT page_namespace, page_title
FROM (
SELECT * FROM redirect
WHERE rd_namespace = 102
) rd
LEFT JOIN page ON rd_from = page_id
WHERE page_namespace = 4
) rd2
ON pl_namespace = page_namespace AND pl_title = page_titl... | {"runningtime": "90.39", "resultsets": [{"headers": ["page_title", "cl_to"], "rowcount": 210}]} | zhwiki_p |
WP:C unlinked | null | SELECT page.page_title
FROM page
INNER JOIN templatelinks ON page.page_id = templatelinks.tl_from
WHERE templatelinks.tl_title = 'Jogsértő'
AND page.page_namespace = 0
AND page.page_title NOT IN ( # page is not listed on WP:C
SELECT pagelinks.pl_title
FROM pagelinks
WHERE pl_from = 404
); | {"runningtime": "0.10", "resultsets": [{"headers": ["fa_id", "fa_name", "fa_archive_name", "fa_storage_group", "fa_storage_key", "fa_deleted_user", "fa_deleted_timestamp", "fa_deleted_reason_id", "fa_size", "fa_width", "fa_height", "fa_metadata", "fa_bits", "fa_media_type", "fa_major_mime", "fa_minor_mime", "fa_descrip... | huwiki_p |
get posts list by template name | null | #select * from templatelinks where tl_namespace = 10 and tl_from_namespace = 0 limit 10;
select page.page_title from templatelinks
inner join page
on page.page_id = templatelinks.tl_from
where tl_title like "مواقع_التواصل_الاجتماعي" and tl_from_namespace = 0 limit 100; | {"runningtime": "1.99", "resultsets": [{"headers": ["page_title", "rev_timestamp"], "rowcount": 13}]} | arwiki |
Page Gender vs Editor Gender | null | SELECT cl_to, up_value, count(1)
FROM revision
JOIN categorylinks ON cl_from = rev_page and cl_to IN ('Mann', 'Frau')
JOIN actor ON rev_actor = actor_id
LEFT JOIN user_properties up ON up_user = actor_user AND up.up_property = 'gender'
GROUP BY 1,2 | {"runningtime": "0.09", "resultsets": [{"headers": ["New CX articles", "New non-CX articles", "Deleted CX articles", "Deleted non-CX articles", "Deleted CX %", "Deleted non-CX %", "Deletion % difference"], "rowcount": 1}]} | dewiki_p |
List of template with excessive fair use images (arwiki) | null | USE arwiki_p;
SELECT pagetitle, cnt FROM
(
SELECT concat('* [[قالب:', p.page_title, ']]') as pagetitle, count(*) AS cnt
FROM page p
INNER JOIN imagelinks i ON i.il_from = p.page_id
AND i.il_from_namespace = 10
INNER JOIN page i_p ON i.il_to = i_p.page_title AND 1 <> p.page_is_redirect
INNER JOIN categorylinks ... | {"runningtime": "1.15", "resultsets": [{"headers": ["page_title"], "rowcount": 12}]} | arwiki |
Orphaned article talk (idwiki) | null | SELECT CONCAT("{{Delete talk|Pembicaraan:",p1.page_title,"}}") AS page_title
FROM page AS p1
WHERE p1.page_title NOT LIKE '%/%'
AND p1.page_namespace = 1
AND NOT EXISTS (SELECT 1
FROM page AS p2
WHERE p2.page_namespace = 0
AND p1.page_title = p2.page_title) | {"runningtime": "21.32", "resultsets": [{"rowcount": 1, "headers": ["count(page_id)"]}]} | idwiki_p |
Orphaned category talk (idwiki) | null | SELECT CONCAT("# [[Pembicaraan kategori:",p1.page_title,"]]") AS page_title
FROM page AS p1
WHERE p1.page_title NOT LIKE '%/%'
AND p1.page_namespace = 15
AND NOT EXISTS (SELECT 1
FROM page AS p2
WHERE p2.page_namespace = 14
AND p1.page_title = p2.page_title) | {"runningtime": "4.10", "resultsets": [{"rowcount": 211, "headers": ["title", "redir", "sortkey", "length", "page_latest"]}]} | idwiki_p |
Orphaned project talk (idwiki) | null | SELECT CONCAT("# [[Pembicaraan Wikipedia:",p1.page_title,"]]") AS page_title
FROM page AS p1
WHERE p1.page_title NOT LIKE '%/%'
AND p1.page_namespace = 5
AND NOT EXISTS (SELECT 1
FROM page AS p2
WHERE p2.page_namespace = 4
AND p1.page_title = p2.page_title) | {"runningtime": "1.27", "resultsets": [{"headers": ["title", "redir", "sortkey", "length", "page_latest", "#cat"], "rowcount": 201}]} | idwiki_p |
Orphaned template talk (idwiki) | null | SELECT CONCAT("# [[Pembicaraan templat:",p1.page_title,"]]") AS page_title
FROM page AS p1
WHERE p1.page_title NOT LIKE '%/%'
AND p1.page_namespace = 11
AND NOT EXISTS (SELECT 1
FROM page AS p2
WHERE p2.page_namespace = 10
AND p1.page_title = p2.page_title) | {"runningtime": "0.97", "resultsets": [{"rowcount": 174, "headers": ["title", "redir", "sortkey", "length", "page_latest", "#cat"]}]} | idwiki_p |
Orphaned file talk (idwiki) | not working; "cross wiki" joins are no longer possible due to technical changes see: https://wikitech.wikimedia.org/wiki/News/Wiki_Replicas_2020_Redesign, | SELECT concat('* [[File talk:', p.page_title, ']] ') as Pagetitle
FROM page p
LEFT OUTER JOIN page i_p ON i_p.page_title = p.page_title AND i_p.page_namespace = 6
WHERE p.page_namespace = 7 AND i_p.page_title is null AND ci_p.page_title is null; | {"runningtime": "32.51", "resultsets": [{"headers": ["user_name", "rc_this_oldid", "comment_text"], "rowcount": 100}]} | idwiki_p |
Possibly non-useful files | null | select img_name from image where
img_name not like '%.jpg' collate utf8_general_ci
and img_name not like '%.jpeg' collate utf8_general_ci
and img_name not like '%.gif' collate utf8_general_ci
and img_name not like '%.png' collate utf8_general_ci
and img_name not like '%.pdf' collate utf8_general_ci
and img_name not lik... | {"runningtime": "0.08", "resultsets": [{"rowcount": 10, "headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"]}]} | idwiki_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 @dbname = 'kkwiki';
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
... | {"runningtime": "7.31", "resultsets": [{"headers": ["Date", "ID", "Length", "Page", "Comment", "actor_name"], "rowcount": 1000}]} | kkwiki_p |
Query sandbox | Example queries: https://wikitech.wikimedia.org/wiki/Help:MySQL_queries/Example_queries
MediaWiki database layout: https://www.mediawiki.org/wiki/Manual:Database_layout | SELECT
COUNT(*),
TRIM(LEADING 'www.' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(el_to, '/', 3),'/',-1)) AS site
FROM externallinks, page
WHERE el_from = page_id
AND page_namespace = 0
GROUP BY 2
HAVING COUNT(*) > 10
ORDER BY 1; | {"runningtime": "0.14", "resultsets": [{"rowcount": 34, "headers": ["page_title", "page_namespace"]}]} | idwiki_p |
Look for capitalized descriptions in Bosnian | https://doc.wikimedia.org/Wikibase/master/php/md_docs_storage_terms.html | # https://doc.wikimedia.org/Wikibase/master/php/md_docs_storage_terms.html
SELECT
CONCAT('Q', wbit_item_id) AS qid,
wby_name AS type,
wbxl_language AS lang,
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
LEF... | {"runningtime": "22.21", "resultsets": [{"rowcount": 12, "headers": ["page_namespace", "page_title"]}]} | wikidatawiki_p |
max_statement_time | 198.207.223.xxx | SET statement max_statement_time = 3 for
select * from revision
limit 1; | {"runningtime": "15.89", "resultsets": [{"headers": ["concat(\"Category:\",page_title)", "page_len"], "rowcount": 9176}]} | enwiki_p |
KeFe által létrehozott lapok | null | select page.page_title, revision.rev_timestamp
from page
inner join revision on revision.rev_page = page.page_id
inner join actor on revision.rev_actor = actor.actor_id
where page.page_is_redirect = 0 # exclude redirects
and revision.rev_id = (select min(revision2.rev_id) from revision as revision2 where revision2.rev_... | {"runningtime": "0.06", "resultsets": [{"rowcount": 0, "headers": ["rc_id", "rc_timestamp", "rc_actor", "rc_namespace", "rc_title", "rc_comment_id", "rc_minor", "rc_bot", "rc_new", "rc_cur_id", "rc_this_oldid", "rc_last_oldid", "rc_type", "rc_source", "rc_patrolled", "rc_ip", "rc_old_len", "rc_new_len", "rc_deleted", "... | huwiki_p |
abwiki Latin letters | null | select
page_title,
page_namespace
from
page
where
page_title RLIKE '[A-Za-z]'
and page_is_redirect <> 1
and page_namespace not in (2,3,5,6,7,8,9,10,11,14,15,828)
and not (page_namespace in (0,1) and page_title in (
"Баграт_III_(Қырҭтәыла)",
"Вахтанг_I_Горгасал",
"Вилгелм_II_(Англиа_... | {"runningtime": "0.92", "resultsets": [{"rowcount": 0, "headers": ["actor_name", "rc_timestamp", "rc_namespace", "rc_title", "rc_comment_id", "rc_new_len", "rc_deleted"]}]} | abwiki_p |
All edits made by participants of One million Malayalam labels | null | USE wikidatawiki_p;
select now();
SELECT rev_id, rc_timestamp, actor_name, rc_title, comment_text
FROM recentchanges
LEFT JOIN comment ON comment.comment_id = recentchanges.rc_comment_id
LEFT JOIN actor on actor.actor_id = recentchanges.rc_actor
LEFT JOIN revision on revision.rev_id = recentchanges.rc_this_oldid
WHER... | {"runningtime": "0.06", "resultsets": [{"rowcount": 1, "headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"]}]} | wikidatawiki_p |
Users using the Edit Request Helper Script (since timestamp...) | null | select actor_name, count(distinct r.rev_id)Requests from change_tag ct join revision r on ct.ct_rev_id = r.rev_id join actor a on a.actor_id = r.rev_actor where ct_tag_id = 589
and r.rev_timestamp > 20210315000000
group by actor_name
order by count(distinct r.rev_id) desc; | {"runningtime": "0.14", "resultsets": [{"headers": ["page_title"], "rowcount": 13}]} | enwiki_p |
Q of enwiki title | null | use wikidatawiki_p;
SELECT ips_item_id, ips_site_page
from wb_items_per_site, sites
WHERE ips_site_id = "enwiki"
AND ips_site_id = site_global_key
AND ips_site_page in (
"Late Triassic",
"Yinotheria",
"Australosphenida",
"Theriiformes",
"Holotheria",
"Trechnotheria",
"Cladotheria",
"Afroinsectiphilia",
"Eulipotyphla"... | {"runningtime": "0.42", "resultsets": [{"rowcount": 183, "headers": ["page_title"]}]} | wikidatawiki_p |
zhwiki title of Q | null | use wikidatawiki_p;
SELECT ips_item_id, ips_site_page
from wb_items_per_site, sites
WHERE ips_site_id = "zhwiki"
AND ips_site_id = site_global_key
AND ips_item_id in (
18696,
36857,
42621,
63587,
132666,
132813,
133024,
133270,
133342,
176946,
188419,
209174,
215402,
220315,
234792,
328369,
366723,
372949,
381728,
38... | {"runningtime": "0.41", "resultsets": [{"rowcount": 183, "headers": ["page_title", "page_len", "rev_timestamp"]}]} | wikidatawiki_p |
wiktionary various queries | null | SELECT DISTINCT
REPLACE(page_title, '_', ' ') AS page
FROM page
JOIN categorylinks
ON cl_from = page_id
JOIN revision ON rev_page = page_id
WHERE page_title LIKE '%talist'
AND page_namespace = 0
AND cl_to = "Svenska/Substantiv"
ORDER BY rev_timestamp DESC
LIMIT 3000; | {"runningtime": "0.07", "resultsets": [{"rowcount": 1, "headers": ["user_name"]}]} | svwiktionary_p |
Latest Edits | null | select
CONCAT(substr(rc_timestamp,1,4),"-",substr(rc_timestamp,5,2), "-",substr(rc_timestamp,7,2)," ",substr(rc_timestamp,9,2)+7,":",substr(rc_timestamp,11,2)) as 'Timestamp',
actor_name, rc_title,
cast(rc_new_len as int) - cast(rc_old_len as int) as 'total diff'
from recentchanges_userindex
left join actor on rc_act... | {"connection_id": 13362410} | idwiki |
SDC edits by user and edit summary #WMSE-GLAM-musikverket | null | SELECT page_title, comment_text
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
LEFT JOIN revision r2 ON r1.rev_parent_id = r2.rev_id
WHERE actor_name IN ('AliciaFagervingWMSE-bot')
AND ... | {"runningtime": "0.10", "resultsets": [{"rowcount": 1, "headers": ["user_id"]}, {"rowcount": 1, "headers": ["up_user", "up_property", "up_value"]}]} | commonswiki_p |
Submitted drafts with 0 or 1 external links | These are often easy declines, because you usually need around 3 sources to pass GNG. Help thin out the queue a bit. Still needs manual review though, because 1) some drafts qualify for an SNG, and 2) some drafts have citations such as books that don't include an external link.
The lowest # of external links a draft c... | SELECT page_namespace,
page_title,
( SELECT COUNT(*) FROM externallinks WHERE el_from = page_id ) AS externallinks_count
FROM categorylinks
JOIN page ON page_id = cl_from
WHERE cl_to = 'Pending_AfC_submissions'
AND page_namespace = 118
AND ( SELECT COUNT(*) FROM externallinks WHERE el_from = page_id ) < 26 /*... | {"runningtime": "73.13", "resultsets": [{"rowcount": 1, "headers": ["count(DISTINCT(page_id))", "rev_id", "rev_page", "MIN(rev_timestamp)"]}]} | enwiki |
RedWarn Users (expanded, expensive) | Same as the "RedWarn Users (expanded)" query, but now checks for edit summaries containing the "TW" signature appended to Twinkle edits. This removes reliance on the "twinkle" tag entirely. | -- =======================================================================
-- This query will check Wikipedia for all edits tagged with "RedWarn",
-- and find all users of RedWarn from these changes. This also includes
-- users who have used RedWarn previously but have since uninstalled
-- RedWarn. Since RedWarn is com... | {"runningtime": "0.80", "resultsets": [{"rowcount": 17, "headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"]}]} | enwiki_p |
Files on lb.wiki with old versions | null | #USE lbwiki_p;
SELECT CONCAT("# [[:File:", oi_name, "]]")
FROM oldimage
INNER JOIN page p ON p.page_title = oi_name AND p.page_namespace = 6
INNER JOIN categorylinks c ON c.cl_from = p.page_id AND c.cl_to = "All_net_fräi_Medien" #Non-free files
#INNER JOIN categorylinks c ON c.cl_from = p.page_id AND c.cl_to = "सभी_मुक... | {"runningtime": "0.59", "resultsets": [{"headers": ["rc_id", "rc_timestamp", "rc_actor", "rc_namespace", "rc_title", "rc_comment_id", "rc_minor", "rc_bot", "rc_new", "rc_cur_id", "rc_this_oldid", "rc_last_oldid", "rc_type", "rc_source", "rc_patrolled", "rc_ip", "rc_old_len", "rc_new_len", "rc_deleted", "rc_logid", "rc_... | lbwiki_p |
Löschanträge seit 1. Januar 2021 - dewiki | null | use dewiki_p;
SELECT count(*) AS Anzahl, actor_name
FROM page, revision, actor_revision, comment_revision
WHERE page_title LIKE "Löschkandidaten/%"
AND page_namespace = 4
AND page_id = rev_page
AND rev_actor = actor_id
AND comment_id = rev_comment_id
AND comment_text like "Neuer Abschnitt%"
AND rev... | {"runningtime": "2.19", "resultsets": [{"rowcount": 1, "headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"]}]} | dewiki_p |
genus not redirects (partly working) | null | #NB! some redirects still here
SELECT page_title
FROM page
WHERE page_is_redirect = 0
AND page_title LIKE '%(barnacle)'
AND page_namespace = 0
GROUP BY page_title
ORDER BY page_title ASC
LIMIT 49; | {"runningtime": "0.07", "resultsets": [{"rowcount": 0, "headers": ["tl_from", "tl_namespace", "tl_title", "tl_from_namespace"]}]} | enwiki_p |
Content translation creation statistics, translator name in a month | Main namespace articles that were created using Content Translation and not using Content Translation and subsequently deleted. Edit month as needed | select
ctd_id
from
change_tag_def
where
ctd_name = 'huggle' | {"runningtime": "10.70", "resultsets": [{"headers": ["page_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["pa... | ruwiki_p |
CEE Spring 2021 in Ukraine [technical] | List of articles created for the Investigative Journalism Week on UkWiki | USE ukwiki_p;
SET SESSION group_concat_max_len = 10000;
SELECT @rownum := @rownum + 1 AS rank,
IFNULL(actor_name, 'Всього'),
newbie
FROM
(
SELECT
CONCAT('[https://uk.wikipedia.org/w/index.php?title=Спеціальна:Список_користувачів&limit=1&username=', actor_name, ' ', actor_name, ']') as actor_name,
... | {"runningtime": "0.09", "resultsets": [{"headers": ["log_id", "user_name", "user_editcount", "comment_text"], "rowcount": 5}]} | ukwiki_p |
Short user talk pages created by users other than the talk page owner (different wikis) | null | select distinct page_len, page_title, page_touched, actor_name, user_editcount from page join revision on page_id = rev_page inner join actor on rev_actor = actor_id left join user on actor_user = user_id
where page_namespace = 3 and page_is_new = 1 and page_title not regexp "/" and page_len between 1 and 15 and actor_... | {"runningtime": "1.37", "resultsets": [{"rowcount": 350, "headers": ["page_title", "user_name", "cnt"]}]} | xalwiki |
Ukwiki GFDL only files by upload date in cat | null | #USE ukwiki_p;
SELECT CONCAT("# [[:File:", page_title, "]]") as File, img_timestamp, actor_name
FROM templatelinks
JOIN page ON tl_from = page_id
JOIN image ON img_name = page_title AND page_namespace = 6
JOIN actor_image ON img_actor = actor_id
JOIN categorylinks
ON cl_from = page_id
AND cl_type = "file"
AND cl_to =... | {"runningtime": "65.59", "resultsets": [{"rowcount": 227, "headers": ["user_name", "rc_this_oldid", "comment_text"]}]} | ukwiki_p |
Huji contribs in Supervisory Council case talk pages | null | select
page_title,
count(*)
from revision
join page
on rev_page = page_id
join actor
on actor_id = rev_actor
where
actor_name = 'Huji'
and page_namespace = 5
and page_title like 'تابلوی_اعلانات_هیئت_نظارت/دوره_%'
group by page_title
| {"runningtime": "17.85", "resultsets": [{"rowcount": 0, "headers": ["page_title"]}, {"rowcount": 0, "headers": ["page_title"]}, {"rowcount": 0, "headers": ["page_title"]}, {"rowcount": 0, "headers": ["page_title"]}, {"rowcount": 0, "headers": ["page_title"]}, {"rowcount": 0, "headers": ["page_title"]}, {"rowcount": 1, ... | fawiki_p |
All book links | null | SELECT CONCAT(page_namespace, ":", page_title)
FROM page
WHERE page_id
IN (SELECT pl_from
FROM pagelinks
WHERE pl_namespace=109); | {"runningtime": "0.14", "resultsets": [{"rowcount": 50, "headers": ["page_title"]}]} | enwiki |
Page(s) in between two given pages by links | null | SELECT midpage.page_title
FROM page startpage
INNER JOIN pagelinks startlinks ON startlinks.pl_from = startpage.page_id
INNER JOIN page midpage ON midpage.page_title = startlinks.pl_title
INNER JOIN pagelinks midlinks ON midlinks.pl_from = midpage.page_id
WHERE startlinks.pl_namespace = 0
AND midlinks.pl_namespace = 0
... | {"runningtime": "1.14", "resultsets": [{"rowcount": 541, "headers": ["page_title"]}]} | enwiki_p |
Labels with comma in Swedish | Labels with parenthesis in Swedish, likely disambiguation imported from Wikipedia (e.g. US cities). | SELECT
CONCAT('Q', wbit_item_id) AS qid,
wbx_text as label
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_lang ON wbtl_text_in_lang_id = wbxl_id
LEFT JOIN wbt_text ON wbxl_text_id = wbx_id
WHERE
wby_name = 'label... | {"runningtime": "0.94", "resultsets": [{"rowcount": 2, "headers": ["page_title", "rev_timestamp"]}]} | wikidatawiki_p |
Labels with parenthesis in Swedish | Labels with parenthesis in Swedish, likely disambiguation imported from Wikipedia. | SELECT
CONCAT('Q', wbit_item_id) AS qid,
wbx_text as label
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_lang ON wbtl_text_in_lang_id = wbxl_id
LEFT JOIN wbt_text ON wbxl_text_id = wbx_id
WHERE
wby_name = 'label... | {"runningtime": "61.79", "resultsets": [{"rowcount": 285, "headers": ["cl_to", "count_cl_to"]}]} | wikidatawiki_p |
Find most recent changes on Wikidata to stuff in Bengali | (Ripped from wdvd's code and modified a bit.)
Thanks, Adam, for further modifications! | SELECT rc_id, rc_timestamp, actor_name, rc_title, comment_text
FROM recentchanges
LEFT JOIN comment ON comment.comment_id = recentchanges.rc_comment_id
LEFT JOIN actor on actor.actor_id = recentchanges.rc_actor
WHERE (
comment_text REGEXP 'wbsetdescription-(add|set|remove)...(bn)'
OR comment_text REGEXP 'wbsetlabel-... | {"runningtime": "0.04", "resultsets": []} | wikidatawiki_p |
Women total, not bots, with at least 1 edit | Fork from https://quarry.wmflabs.org/query/3921 | SELECT COUNT(DISTINCT rev_actor) AS WomenTotal FROM revision WHERE rev_actor IN
(
SELECT user_id FROM user JOIN user_properties ON user_id=up_user WHERE
up_property = 'gender' AND up_value = 'female'
);
SELECT COUNT(DISTINCT rev_actor) AS MenTotal FROM revision WHERE rev_actor IN
(
SELECT user_id FROM user ... | {"runningtime": "6.52", "resultsets": [{"rowcount": 100, "headers": ["log_id", "log_timestamp", "user", "log_title", "log_params", "summary"]}]} | idwiki_p |
kategori bazlı eksik sayfalar | null | USE enwiki_p;
SELECT CONCAT('* [[',page_title,']]') AS "Maddeler"
FROM page
JOIN categorylinks
ON cl_from = page_id
WHERE cl_to = "History"
AND page_namespace = 0
AND NOT EXISTS (SELECT * FROM langlinks WHERE ll_from = page_id AND ll_lang = "tr")
ORDER BY page_title
limit 100;
| {"runningtime": "152.20", "resultsets": [{"rowcount": 8, "headers": ["Username", "cnt"]}]} | enwiki_p |
Pages of WikiProject Catholicism with redlinks | null | SELECT DISTINCT pagelinks.pl_title
FROM page talkpage
INNER JOIN categorylinks ON talkpage.page_id = categorylinks.cl_from
INNER JOIN page mainpage ON mainpage.page_title = talkpage.page_title
INNER JOIN pagelinks ON mainpage.page_id = pagelinks.pl_from
WHERE categorylinks.cl_to = "WikiProject_Catholicism_articles"
... | {"runningtime": "7.42", "resultsets": [{"rowcount": 1246, "headers": ["Page"]}]} | enwiki_p |
Transclusions of missing templates | Code from https://github.com/fastily/fastilybot-toolforge/blob/master/scripts/report14.sql | SELECT t.tl_title FROM templatelinks t
LEFT JOIN page p
ON p.page_namespace = t.tl_namespace AND p.page_title = t.tl_title
INNER JOIN page p2
ON t.tl_from = p2.page_id
WHERE p.page_title IS NULL AND t.tl_namespace = 10 AND p2.page_content_model="wikitext"
GROUP BY 1
LIMIT 500; | {"runningtime": "5.13", "resultsets": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %"], "rowcount": 92}]} | enwiki_p |
2021 thanks statistic on idwiki | null | SELECT actor_name As Username, COUNT(log_id) As Total_thanks
FROM logging_logindex
JOIN actor_logging ON actor_id = log_actor
WHERE
log_type = "thanks" AND
log_timestamp >= "20210000000000"
GROUP BY actor_name
ORDER BY 2 DESC | {"runningtime": "0.64", "resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"], "rowcount": 95}]} | idwiki_p |
2021 move statistic (idwiki) | null | SELECT actor_name As Username, COUNT(log_id) As Moved_page
FROM logging_logindex
JOIN actor_logging ON actor_id = log_actor
WHERE
log_type = "move" AND
log_timestamp >= "20210000000000"
GROUP BY actor_name
ORDER BY 2 DESC | {"runningtime": "1.33", "resultsets": [{"rowcount": 744, "headers": ["page_title"]}]} | idwiki_p |
New pages created using content translation in 2021 (idwiki) | All publishings from Content translation tool, repeat publishings are not counted, first time overwriting is counted | select
concat(substr(rev_timestamp,1,4),"-",substr(rev_timestamp,5,2),"-",substr(rev_timestamp,7,2)) as Date_time,
actor_name as User,
page_title, rev_len
from
change_tag,
change_tag_def,
revision,
page,
actor
where
ct_tag_id = ctd_id
and rev_id = ct_rev_id
and page_id = rev_page
and page_namesp... | {"runningtime": "0.94", "resultsets": [{"headers": ["page_title"], "rowcount": 0}]} | idwiki_p |
Enhanced source usage: last 90d, en.wiki | null | select actor_name, count(*) as total
from (
select ct.ct_id, ct.ct_rev_id, actor_user, actor_name
from enwiki_p.change_tag ct
inner join enwiki_p.revision_actor_temp rat
on ct.ct_rev_id = rat.revactor_rev
inner join enwiki_p.actor act
on rat.revactor_actor = act.actor_id
inner join enwiki_p.change_tag_def
on ct_tag_i... | {"runningtime": "0.08", "resultsets": [{"rowcount": 4, "headers": ["concat(page_title)", "page_len"]}]} | enwiki_p |
edo - nlwiki_p Anonymous edits rc_patrolled summary | forked from Bdijkstra - show all unpatrolled edits for the last weeks by day/user/lemma | USE nlwiki_p;
# 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... | {"runningtime": "0.30", "resultsets": [{"rowcount": 100, "headers": ["Timestamp", "actor_name", "rc_title", "total diff"]}]} | nlwiki |
ruwiki-en | null | SELECT
count(*) AS count,
pa.page_title
FROM
page pa, langlinks l1
where pa.page_namespace = 0
and pa.page_id = l1.ll_from
and not exists (select 1 from langlinks l2 where l1.ll_from=l2.ll_from and l2.ll_lang='en')
group by pa.page_id, pa.page_title
order by count(*) desc, pa.page... | {"runningtime": "2.95", "resultsets": [{"rowcount": 891, "headers": ["page_title"]}]} | ruwiki |
Empty file page (idwiki) | null | SELECT * FROM page WHERE page_namespace = 6 AND page_len = 0; | {"runningtime": "5.47", "resultsets": [{"rowcount": 2000, "headers": ["page_namespace", "page_title"]}]} | idwiki_p |
Mainspace non-redirects with curly singlequotes | For [[WP:VPT#articles with curly quotes in title]] circa 3 July 2020. | SELECT page_title
FROM page
WHERE page_namespace = 0 -- article namespace only
AND page_is_redirect = 0 -- non-redirects
AND page_title RLIKE "‘|’|`|´"; | {"runningtime": "0.49", "resultsets": [{"rowcount": 10, "headers": ["pl_from", "pl_namespace", "pl_title", "pl_from_namespace", "page_title"]}]} | enwiki |
zhwiki: Search comments | null | SELECT comment_text
FROM comment
WHERE comment_text LIKE "%[[WP:VN%"
ORDER BY comment_id DESC | {"runningtime": "4.88", "resultsets": [{"headers": ["rev_user_text", "recent_user_editcount"], "rowcount": 500}]} | zhwiki_p |
WhatLinksHere current | null | SELECT page_id, page_namespace, page_title, rd_from, rd_fragment, page_is_redirect
FROM (
SELECT pl_from, rd_from, rd_fragment
FROM `pagelinks`
LEFT JOIN `redirect`
ON ((rd_from = pl_from)
AND rd_title = 'P248'
AND (rd_interwiki = '' OR rd_interwiki IS NULL)
AND rd_namespace =... | {"runningtime": "177.25", "resultsets": [{"rowcount": 29375, "headers": ["wbit_item_id", "wbxl_language", "wbtl_type_id", "wbx_text"]}]} | wikidatawiki_p |
Non-free image used outside main namespace (idwiki) | null | SELECT DISTINCT CONCAT('[[Istimewa:Pranala_balik/Berkas:', p.page_title, ']]') FROM page p
INNER JOIN categorylinks c ON p.page_id = c.cl_from
INNER JOIN (imagelinks i LEFT JOIN redirect r ON i.il_from = r.rd_from) ON p.page_title = i.il_to
WHERE c.cl_to = "Semua_media_nonbebas"
AND i.il_from_namespace != 0
AND r.rd_fr... | {"runningtime": "957.39", "resultsets": [{"headers": ["id", "type", "language", "text"], "rowcount": 61339}]} | idwiki_p |
Users by gender by Month | null | SELECT LEFT(rev_timestamp,6) ym, up_value, count(1) edits, count(distinct actor_user) users
FROM revision
JOIN actor ON rev_actor = actor_id
LEFT JOIN user_properties up ON up_user = actor_user and up.up_property = 'gender'
GROUP BY 1,2 | {"runningtime": "0.29", "resultsets": [{"rowcount": 8, "headers": ["user", "edit_count"]}]} | dewiki_p |
Users by gender | null | SELECT LEFT(rev_timestamp,6) ym, up_value, count(1) edits, count(distinct actor_user) users
FROM revision
JOIN actor ON rev_actor = actor_id
LEFT JOIN user_properties up ON up_user = actor_user and up.up_property = 'gender'
GROUP BY 1,2 | {"runningtime": "1.37", "resultsets": [{"rowcount": 881, "headers": ["CONCAT('File:', page_title, '|[[:File:', page_title, ']] (', COUNT(rev_id), ')')"]}]} | dewiki_p |
2021 Pacific typhoon season analysis: Zero-diff edits by user | Part of [[w:en:User:Chlod/Analysis/2021 Pacific typhoon season]]. | SET @page = "2021 Pacific typhoon season";
SELECT
actor_name,
COUNT(
IF((
CAST(r1.rev_len AS SIGNED) -
CAST((
SELECT
r2.rev_len
FROM revision r2
WHERE r2.rev_id = r1.rev_parent_id
) AS SIGNED)
) = 0, 1, NULL)
) as `Zero-di... | {"runningtime": "0.35", "resultsets": [{"rowcount": 138, "headers": ["ans", "article", "rns", "redlink"]}]} | enwiki_p |
bad XNRs (checking different wikis) | null | Use enwiktionary_p;
Select page_title, rd_title, rd_namespace from page join redirect on page_id = rd_from
Where page_namespace = 0
And rd_namespace != 0;
Select page_title, rd_title, rd_namespace from page join redirect on page_id = rd_from
Where page_namespace = 14
And rd_namespace = 14; | {"runningtime": "0.10", "resultsets": [{"rowcount": 12, "headers": ["page_namespace", "count(DISTINCT page_title)"]}]} | enwiktionary |
Abusefilter log statistic (idwiki) | null | SELECT actor_name As User, COUNT(log_id) As Count
FROM logging
JOIN actor ON log_actor=actor_id
WHERE log_type="abusefilter"
GROUP BY actor_name
ORDER BY COUNT(*) DESC
LIMIT 500; | {"runningtime": "20.63", "resultsets": [{"rowcount": 26, "headers": ["page_title"]}]} | idwiki_p |
2021 deletion statistic (idwiki) | null | SELECT actor_name As Username, COUNT(log_id) As Deleted_page
FROM logging_logindex
JOIN actor_logging ON actor_id = log_actor
WHERE
log_type = "delete" AND
log_timestamp >= "20210000000000"
GROUP BY actor_name
ORDER BY 2 DESC | {"runningtime": "223.40", "resultsets": [{"rowcount": 68806, "headers": ["log_type", "log_action", "log_timestamp", "log_title", "log_comment_id", "comment_text"]}]} | idwiki_p |
Large talk page (idwiki) | null | select
page_id,
concat("[[Pembicaraan:", page_title,"]]") as page_full_title,
page_len
from page
where
page_namespace = 1
and page_title not like '%/%'
and page_len > 5000
and not exists (
select 1
from templatelinks
where tl_from = page_id
and tl_title = "Hsf... | {"runningtime": "54.54", "resultsets": [{"rowcount": 24060, "headers": ["log_type", "log_action", "log_timestamp", "log_title", "log_comment_id", "comment_text"]}]} | idwiki_p |
Main page redirect with large text (idwiki) | Redirect containing large text (> 200) byte on idwiki | SELECT CONCAT('[https://id.wikipedia.org/w/index.php?title=', page_title, '&redirect=no ', page_title,']') As Title, page_len As Page_len FROM page
WHERE page_is_redirect=1 AND page_namespace=0 AND page_len > 250 ORDER BY page_len DESC
LIMIT 1000; | {"runningtime": "36.39", "resultsets": [{"headers": ["log_type", "log_action", "log_timestamp", "log_title", "log_comment_id", "comment_text"], "rowcount": 22433}]} | idwiki_p |
nlwiki Most used templates | null | SELECT
COUNT(*) AS `count`,
tl_namespace AS ns,
tl_title AS title,
GROUP_CONCAT(DISTINCT pr_type) AS type,
GROUP_CONCAT(DISTINCT pr_level) AS `level`,
GROUP_CONCAT(DISTINCT pr_expiry) AS expiry
FROM templatelinks, page LEFT JOIN page_restrictions ON page_id=pr_page
WHERE page_namespace=tl_namespace... | {"runningtime": "4.07", "resultsets": [{"rowcount": 1000, "headers": ["rank", "log_title", "COUNT(log_title)"]}]} | nlwiki |
кирлат | null | select page_title from page where page_namespace=0 and page_is_redirect=0 and lcase(page_title) rlike "[a-z][йцукенгшщхъфывапролджэячсмитьбю]" | {"runningtime": "9.75", "resultsets": [{"rowcount": 5229, "headers": ["File", "img_timestamp", "actor_name"]}]} | ruwikinews |
npr_list | null | SELECT user_name, user_editcount, user_registration, (select rev_timestamp from revision_userindex where rev_actor=(select actor_id from actor where actor_user=user_id) order by rev_timestamp desc limit 1) as 'most_recent_edit_ts'
FROM `user`
INNER JOIN user_groups ug
ON user_id = ug.ug_user AND ug.ug_group = 'patroll... | {"runningtime": "10.13", "resultsets": [{"rowcount": 0, "headers": ["rev_id", "rc_timestamp", "actor_name", "rc_title", "comment_text"]}]} | enwiki |
npr_list | null | SELECT user_name, user_editcount, user_registration, (select rev_timestamp from revision_userindex where rev_actor=(select actor_id from actor where actor_user=user_id) order by rev_timestamp desc limit 1) as 'most_recent_edit_ts'
FROM `user`
INNER JOIN user_groups ug
ON user_id = ug.ug_user AND ug.ug_group = 'patroll... | {"runningtime": "1.80", "resultsets": [{"rowcount": 1, "headers": ["now()"]}, {"rowcount": 754, "headers": ["page_title", "cats", "box"]}]} | enwiki |
Unreviewed changes by trusted users | null | # USE huwiki_p; -- deprecated
SELECT
CONCAT('[[',page1.page_title,']]') AS 'Cím',
CONCAT('[https://hu.wikipedia.org/w/index.php?title=',page1.page_title,'&action=history történet]') AS 'Történet',
CONCAT('[https://hu.wikipedia.org/w/index.php?title=',page1.page_title,'&oldid=',flaggedpage_pending1.fpp_rev_id,'&... | {"runningtime": "0.49", "resultsets": [{"rowcount": 17, "headers": ["Title", "user", "comment"]}]} | huwiki_p |
Revisions to review by bot | null | SELECT
page1.page_title,
page1.page_latest
FROM page as page1
INNER JOIN revision AS lastrevision ON page1.page_latest = lastrevision.rev_id -- used for outputting timestamp of last edit, not used in rest of query
INNER JOIN revision AS revision1 ON page1.page_id = revision1.rev_page
INNER JOIN flaggedpage_pend... | {"runningtime": "0.49", "resultsets": [{"rowcount": 17, "headers": ["Title", "user", "comment"]}]} | huwiki_p |
bnwiki lb | null | USE wikidatawiki_p;
SELECT CONCAT("Q",ips_item_id), "Lbn", CONCAT('"',ips_site_page,'"')
FROM wb_items_per_site
WHERE ips_site_id='bnwikibooks'
AND NOT EXISTS (
SELECT wbit_item_id FROM wbt_item_terms
INNER JOIN wbt_term_in_lang
ON wbtl_id = wbit_term_in_lang_id
INNER JOIN wbt_text_in_lang
ON wbxl_id = ... | {"runningtime": "3.21", "resultsets": [{"rowcount": 1917, "headers": ["log_title", "COUNT(log_id)"]}]} | wikidatawiki |
Change tags | null | use enwiki_p;
select *
from change_tag_def
order by ctd_id | {"runningtime": "1.19", "resultsets": [{"rowcount": 618, "headers": ["concat(\"* [[:\u099a\u09bf\u09a4\u09cd\u09b0:\",REPLACE(page_title, '_', ' '),\"]]\")", "imagelinks", "links"]}]} | enwiki_p |
Week days | null | SET
STATEMENT max_statement_time = 600 FOR
SELECT
user_name,
total,
weekdays,
dist_days
FROM
(
SELECT
rc_actor,
COUNT(*) AS total,
SUM(
CASE
WHEN day = 1 THEN 0
WHEN day = 7 THEN 0
ELSE 1
END
) AS weekdays,
COUNT(DISTINCT day) A... | {"runningtime": "2.28", "resultsets": [{"headers": ["page_title"], "rowcount": 994}]} | enwiki_p |
rowiki users having over 700 edits + all bots, sorted by edit count | This takes into account bots that don't have official bot status, but are nonetheless members of Categorie:Roboți Wikipedia. It also tells whether an account is an admin or a bot. | SELECT ss_total_edits FROM site_stats;
SELECT SUM(user_editcount) FROM user
WHERE user_editcount < 700;
SELECT user.user_id AS user_id, user.user_name AS user_name, user.user_editcount AS user_editcount,
CASE
WHEN (ug.user_admin > 0 OR ue.user_admin > 0) THEN 1
ELSE 0
END AS user_admin,
CASE
WHEN (ug.user_bot ... | {"runningtime": "0.59", "resultsets": [{"rowcount": 10, "headers": ["rc_id", "rc_timestamp", "rc_actor", "rc_namespace", "rc_title", "rc_comment_id", "rc_minor", "rc_bot", "rc_new", "rc_cur_id", "rc_this_oldid", "rc_last_oldid", "rc_type", "rc_source", "rc_patrolled", "rc_ip", "rc_old_len", "rc_new_len", "rc_deleted", ... | commonswiki_p |
2021 Pacific typhoon season copies (rough guess) | null | SET @page = "2021 Pacific typhoon season";
SELECT
DATE_FORMAT(rev_timestamp, "%Y-%m-%d %H:%i:%s") AS 'Date',
rev_id AS 'ID',
actor_name AS 'User',
comment_text AS 'Comment'
FROM revision
JOIN comment_revision ON rev_comment_id = comment_id
JOIN actor_revision ON rev_actor = actor_id
WHE... | {"runningtime": "0.42", "resultsets": [{"rowcount": 28, "headers": ["actor_name", "countt"]}]} | enwiki_p |
RedWarn Users (sysop) | Checks all RedWarn-tagged edits and compiles them into a list of users. Forked from Chlod's fork of AntiCompositeNumber's "RedWarn users" query.
This expands on the previous script based on suggestions from Ed6767. This helps gauge RedWarn's usage relative to total edits and Twinkle edits. Twinkle is also used here si... | -- =======================================================================
-- This query will check Wikipedia for all edits tagged with "RedWarn",
-- and find all users of RedWarn from these changes. This also includes
-- users who have used RedWarn previously but have since uninstalled
-- RedWarn. Since RedWarn is com... | {"runningtime": "9.65", "resultsets": [{"rowcount": 1744, "headers": ["actor_name", "page_title", "rev_len", "Timestamp"]}]} | enwiki_p |
ruwiki: Convenient Discussions script usage: total number of edits (2) | null | select
(
select count(*)
from revision
join change_tag on rev_id = ct_rev_id
where
# marked by tag "convenient-discussions"
ct_tag_id = 79
) +
(
select count(*)
from comment
join revision on comment_id = rev_comment_id
where
rev_timestamp > "20180220000000" and
# having CD link i... | {"runningtime": "1.21", "resultsets": [{"rowcount": 550, "headers": ["page_title"]}]} | ruwiki_p |
nlwiki Pages w/ deletion template w/o link to nomination page | null | /*SELECT page_id, page_title FROM page WHERE page_namespace=4 AND page_title REGEXP '^Te_beoordelen_[^/]+$';*/
/*SELECT page_namespace, page_title
FROM categorylinks, page
WHERE
cl_from=page_id AND (
(cl_to='Wikipedia:Pagina_weg' AND (
(page_namespace=0 AND NOT EXISTS (SELECT * FROM pagelinks WHERE pl_from=336338 ... | {"resultsets": [{"rowcount": 8, "headers": ["log_type", "count(log_type)"]}], "runningtime": "0.85"} | nlwiki |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.