title stringlengths 1 212 | description stringlengths 1 4.39k ⌀ | query stringlengths 1 65.5k ⌀ | extra_info stringlengths 18 31.6k | wikidb stringlengths 4 26 ⌀ |
|---|---|---|---|---|
GA/FA and GAN/FAC linked from September 10 | GA/FA and GAN/FAC linked from [[September 10]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 14, "headers": ["date", "images"]}], "runningtime": "0.34"} | null |
عدد التصنيفات | null | USE arwiki_p;
SELECT COUNT(*) AS "عدد التصانيف"
FROM revision r
join page p on p.page_id=r.rev_page
WHERE p.page_namespace=14 and p.page_is_redirect=0 and r.rev_timestamp between 20030101000000 and 20191231235959 and r.rev_parent_id=0
ORDER BY COUNT(*) DESC
LIMIT 1; | {"resultsets": [{"rowcount": 23, "headers": ["page_title"]}], "runningtime": "2.07"} | null |
عدد القوالب | null | USE arwiki_p;
SELECT COUNT(*) AS "عدد التصانيف"
FROM revision r
join page p on p.page_id=r.rev_page
WHERE p.page_namespace=10 and p.page_is_redirect=0 and r.rev_timestamp between 20030101000000 and 20191231235959 and r.rev_parent_id=0
ORDER BY COUNT(*) DESC
LIMIT 1; | {"resultsets": [{"rowcount": 0, "headers": ["File name", "Date", "Size", "Uploader's name"]}], "runningtime": "394.48"} | null |
WMUA-UA Photo Competition participants 2012-2019 not active in WLM-UA 2019 | WLE-UA Photo Competition participants 2013-2017 not active in 2018 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Earth_2013_in_France",... | {"resultsets": [{"rowcount": 4, "headers": ["Field", "Type", "Null", "Key", "Default", "Extra"]}], "runningtime": "0.23"} | null |
WMUA-UA Photo Competition participants 2012-2019 not active in WLM-UA 2019 | WLE-UA Photo Competition participants 2013-2017 not active in 2018 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2016_in_Malt... | {"resultsets": [{"rowcount": 4, "headers": ["Field", "Type", "Null", "Key", "Default", "Extra"]}], "runningtime": "0.25"} | null |
WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2014_in_Ireland",
"Images_from_... | {"resultsets": [{"rowcount": 10, "headers": ["page_title", "group_concat(SUBSTRING_INDEX(SUBSTRING_INDEX(cl_to, '_\u0641\u064a_', 2), '_\u0641\u064a_', -1))"]}], "runningtime": "4.45"} | null |
WMBD photo contest participants | Wikimedia Bangladesh photo contest participants | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Earth_2017_in_Banglade... | {"resultsets": [{"rowcount": 1, "headers": ["1+1"]}], "runningtime": "0.21"} | null |
WMBD photo contest participants | Wikimedia Bangladesh photo contest participants | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Earth_2017_in_Bangladesh",
"Images_from_W... | {"connection_id": 87034560} | null |
Top 20 users on ptwiki | null | USE ptwiki_p;
SELECT
actor_name,
COUNT(1) AS num_contribs
FROM revision_userindex
join actor on actor_id = rev_actor
GROUP BY rev_actor
ORDER BY num_contribs DESC
LIMIT 20 | {"resultsets": [{"rowcount": 9, "headers": ["page_title"]}], "runningtime": "70.63"} | null |
Top 20 users on ptwiki in last year | null | USE ptwiki_p;
SELECT
actor_name,
COUNT(1) AS num_contribs
FROM revision_userindex
join actor on actor_id = rev_actor
WHERE
rev_timestamp BETWEEN
DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 360 DAY), "%Y%m%d%H%i%S") AND
DATE_FORMAT(NOW(), "%Y%m%d%H%i%S")
GROUP BY rev_actor
ORDER BY num_contribs DESC
LIMIT 20 | {"resultsets": [{"rowcount": 9, "headers": ["page_title"]}], "runningtime": "7.73"} | null |
WLM-NO competition participants 2011-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2011_in_Norway",
"Images_from_W... | {"connection_id": 14145632} | null |
WMUA-UA Photo Competition participants 2012-2019 not active in WLM-UA 2019 | WLE-UA Photo Competition participants 2013-2017 not active in 2018 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2012_i... | {"connection_id": 14216066} | null |
Utenti attivi su voci WLM-IT 2019 | Da un elenco di voci collegate dalle liste di monumenti guardiamo chi le ha modificate dal 2010 in poi, con un numero di contributi pari ad almeno 3 e una quota significativa dei propri contributi totali. Escludiamo gli utenti già molto impegnati (contributi totali > 5k), bloccati o bot. | USE itwiki_p;
SELECT q.page_title, a.actor_name AS Utente, COUNT(r.rev_id) AS Contributi, u.user_editcount
FROM page q
JOIN pagelinks pl
ON q.page_title = pl.pl_title
JOIN page p
ON pl.pl_from = p.page_id
AND p.page_namespace = 102
AND p.page_title LIKE "Wiki_Loves_Monuments_2019/Monumenti/%"
AND pl.pl_namespace = 0
JO... | {"resultsets": [{"rowcount": 0, "headers": ["img_name", "img_size", "img_width", "img_height", "img_metadata", "img_bits", "img_media_type", "img_major_mime", "img_minor_mime", "img_description_id", "img_actor", "img_timestamp", "img_sha1"]}], "runningtime": "0.11"} | null |
WLM Photo Competition participants 2017-2018 | WLE-UA Photo Competition participants 2013-2017 not active in 2018 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2017_in_Ital... | {"resultsets": [{"rowcount": 7, "headers": ["Vikipeedia", "Commons", "page_id"]}], "runningtime": "1.44"} | null |
WLM-IT competition participants 2013-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2013_in_Italy",
"Images_from_Wi... | {"resultsets": [{"rowcount": 1, "headers": ["\"Ce\" like \"ce\""]}], "runningtime": "0.13"} | null |
GA/FA and GAN/FAC linked from September 11 | GA/FA and GAN/FAC linked from [[September 11]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 3493, "headers": ["concat('*[[Template:',page_title,']]')"]}], "runningtime": "12.42"} | null |
zhwiki rc count | null | SELECT COUNT(*)
FROM (
SELECT *
FROM recentchanges
WHERE rc_type IN (0, 1)
AND rc_timestamp < 20190906000000
AND rc_timestamp > 20190905000000
) rc
LEFT JOIN actor ON rc_actor = actor_id
WHERE actor_user IS NULL | {"resultsets": [{"rowcount": 15471, "headers": ["LogMonth", "FilterID", "Freq"]}], "runningtime": "104.54"} | null |
#/living footballers in main namespace 190705 | Number of pages in the enwiki main namespace that are in [[Category:Living people]] and transclude {{Infobox football biography}}. For [[w:en:User:Levivich/Footy AfDs]]. | SELECT COUNT(*)
FROM page
JOIN templatelinks
ON tl_from = page_id
JOIN categorylinks
ON cl_from = page_id
WHERE cl_to = "Stub-Class football in Africa articles"
| {"resultsets": [{"rowcount": 3, "headers": ["il_from", "il_to", "il_from_namespace"]}], "runningtime": "0.12"} | null |
Delete vs upload stats on commons | See how deletions and uploads have changed over time on commons | use commonswiki_p;
select log_type, substring(log_timestamp,1,4), count(*) from logging where
((log_type = 'delete' and log_action = 'delete' )OR ( log_type="upload" and log_action= "upload") ) and log_namespace =6
group by 2,1 limit 40; | {"resultsets": [{"rowcount": 22, "headers": ["user", "edit_count"]}], "runningtime": "1.20"} | null |
Creek counties | See how creek counties are done; state or not? | null | {"resultsets": [{"rowcount": 20, "headers": ["site_id", "site_global_key", "site_type", "site_group", "site_source", "site_language", "site_protocol", "site_domain", "site_data", "site_forward", "site_config"]}], "runningtime": "0.33"} | null |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('*[[:File:', page_title, ']]') AS wikitext FROM commonswiki_p.page JOIN commonswiki_p.categorylinks ON cl_from = page_id JOIN commonswiki_p.templatelinks ON tl_from = page_id WHERE page_namespace = 6 AND cl_to IN (SELECT page_title FROM commonswiki_p.categorylinks JOIN commonswiki_p.page ON cl_from = page... | {"resultsets": [{"rowcount": 10, "headers": ["log_type", "log_action", "log_title", "log_actor", "log_timestamp", "actor_name"]}], "runningtime": "0.47"} | null |
WLM-IN Photo Competition participants 2012-2019 | WLE-UA Photo Competition participants 2013-2017 not active in 2018 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2012_in_Indi... | {"resultsets": [{"rowcount": 4283, "headers": ["log_type", "log_action", "log_title", "log_actor", "log_timestamp", "actor_name", "COUNT(*)"]}], "runningtime": "20.03"} | null |
All New Page Reviewer (including null) activity since Sept 8th 2018 (excluding admins) | NPR activity for all reviewers since Sept 8th 2018 (last 12 months). Shows inactive reviewers. | SELECT t1.reviewer, reviews, `last review` FROM
(
SELECT logtemp.log_user_text AS `reviewer`,
COUNT(logtemp.log_page) AS `reviews`
FROM (
SELECT log_user_text, log_page
FROM logging_userindex
JOIN user_groups ON ug_user = log_user
WHERE log_timestamp BETWEEN 20180708000000 AND NOW()
AND log_type = 'pag... | {"resultsets": [{"rowcount": 15, "headers": ["wikitext"]}], "runningtime": "224.95"} | null |
All New Page Reviewer (including null) activity since Sept 8th 2018 (excluding admins) | NPR activity for all reviewers since Sept 8th 2018 (last 12 months). Shows inactive reviewers. | -- Transformed subquery to a temp table to improve performance
CREATE TEMPORARY TABLE IF NOT EXISTS temp1 AS SELECT
logtemp.actor_name AS `reviewer`,
COUNT(logtemp.log_page) AS `reviews`
FROM
(SELECT
logging_userindex.log_page
FROM
logging_userindex
... | {"resultsets": [{"rowcount": 1203, "headers": ["log_actor"]}], "runningtime": "9.35"} | null |
All New Page Reviewer (including null) activity since Sept 8th 2018 (excluding admins) | NPR activity for all reviewers since Sept 8th 2018 (last 12 months). Shows inactive reviewers. | SELECT
t1.reviewer,
reviews,
`last review`
FROM
(
SELECT
logtemp.actor_name AS `reviewer`,
COUNT(logtemp.log_page) AS `reviews`
FROM
(
SELECT
log_page
FROM
logging_userindex
UNION
SELECT
actor_name
FROM
act... | {"resultsets": [{"rowcount": 1, "headers": ["actor_id", "actor_user", "actor_name"]}], "runningtime": "0.26"} | null |
Wikimedia Greece Photo Competition participants 2015-2019 not active in WLM-UA 2019 | Wikimedia User Group Greece Photo Competition participants 2015-2019 not active in WLM 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "|commons.wikimedia.org}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Earth_2016_in_Greece",... | {"resultsets": [{"rowcount": 4, "headers": ["user_name", "user_registration", "newbie", "uploads"]}], "runningtime": "1.15"} | null |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('*[[:File:', page_title, ']]') AS wikitext FROM commonswiki_p.page JOIN commonswiki_p.categorylinks ON cl_from = page_id JOIN commonswiki_p.templatelinks ON tl_from = page_id WHERE page_namespace = 6 AND cl_to IN (SELECT page_title FROM commonswiki_p.categorylinks JOIN commonswiki_p.page ON cl_from = page... | {"resultsets": [{"rowcount": 1, "headers": ["user_id", "user_name", "user_real_name", "user_password", "user_newpassword", "user_email", "user_options", "user_touched", "user_token", "user_email_authenticated", "user_email_token", "user_email_token_expires", "user_registration", "user_newpass_time", "user_editcount", "... | null |
Hewiki fair use unused pictures 1 | null | use hewiki_p; select concat('# [[:קובץ:', replace(page_title, "_", " "), ']]') as Suspicious_file_title from page as p1 join image on exists
(select * from categorylinks as cl1 where cl_from = page_id and (cl_to = "ויקיפדיה_-_תמונות_שימוש_הוגן" or exists (select * from page as
p2 where p2.page_namespace = 14 and p2.pag... | {"resultsets": [{"rowcount": 32, "headers": ["page_title", "page_len", "cat_pages", "rev_timestamp", "rev_actor"]}], "runningtime": "1190.83"} | null |
Sample N edits by Quarter | Sampling at most N (=3000) edits each quarter (e.g., quarter 1: Jan 2001-Mar 2001) by registered users. | USE enwiki_p;
SELECT rev_id, rev_page, rev_text_id, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_len, rev_parent_id, rev_sha1
FROM revision
WHERE
rev_timestamp BETWEEN '20071001000000' AND '20080101000000'
AND rev_actor!=0
AND rev_page in (SELECT page_id FROM page WH... | {"resultsets": [{"rowcount": 10, "headers": ["cat_id", "cat_title", "cat_pages", "cat_subcats", "cat_files"]}], "runningtime": "0.11"} | null |
Monumental-glam: count of unique pages of items in Sweden edited | null | USE wikidatawiki_p;
SELECT
COUNT(
DISTINCT(r.rev_page)
) as num_pages
FROM
wikidatawiki_p.revision r
JOIN change_tag ON r.rev_id=change_tag.ct_rev_id
JOIN wikidatawiki_p.pagelinks pagelinks ON r.rev_page=pagelinks.pl_from
WHERE
change_tag.ct_tag_id=604 -- OAuth CID: 1311
AND pagelinks.pl_title="Q34" ... | {"resultsets": [{"rowcount": 1000, "headers": ["rd_from", "rd_namespace", "rd_title", "rd_interwiki", "rd_fragment", "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", "p... | null |
বাংলা উইকিতে সবচেয়ে বেশী নিবন্ধ সৃষ্টি করা ব্যবহারকারী | ১৫-০২-২০১৯ অনুসারে | USE bnwiki_p;
SELECT
CONCAT("[[ব্যবহারকারী:",user_name,"|",user_name,"]]") AS user_name,
COUNT(rev_id) AS মোট_নিবন্ধ
FROM user INNER JOIN revision
ON revision.rev_user = user.user_id
JOIN page
ON page.page_id = revision.rev_page
WHERE page_is_redirect = 0
AND rev_parent_id = 0
AND page_namespace = 0
AND rev_timestamp <... | {"connection_id": 88334129} | null |
enwiki inactive special users | null | use enwiki_p;
SELECT user_name, user_editcount, user_registration, rev_timestamp AS 'Last edit', ug1.ug_group AS 'user_groups'
FROM `user`
LEFT JOIN user_groups ug1
ON user_id = ug1.ug_user AND ug1.ug_group IN ('ipblock-exempt', 'interface-admin')
JOIN actor
ON actor_user = user_id
JOIN revision_userindex
ON rev_id ... | {"connection_id": 88338949} | null |
MILHIST biographies | null | SELECT CONCAT('Talk:', page_title) AS talk_page
FROM page
WHERE
page_namespace = 1
AND page_id IN (
SELECT tl_from
FROM templatelinks
WHERE
tl_from_namespace = 1
AND tl_namespace = 10
AND tl_title IN (
"WikiProject_Military_History", "WPCAS", "WikiProject_Colditz", "MILHIST", "... | {"resultsets": [{"rowcount": 9, "headers": ["page_title", "page_namespace", "cl_timestamp", "cl_sortkey"]}, {"rowcount": 90, "headers": ["cl_from", "cl_to", "cl_timestamp", "cl_sortkey"]}], "runningtime": "9.60"} | null |
rowiki users having over 625 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. | USE arwiki_p;
SELECT ss_total_edits FROM site_stats;
SELECT SUM(user_editcount) FROM user AS u
WHERE user_editcount <= 625;
SELECT *
FROM (
SELECT fi.id AS userid, fi.name AS name, fi.edits AS editcount,
CASE
WHEN fi.admin=1 OR se.admin=1 THEN 1
ELSE 0
END AS admin,
CASE
WHEN (fi.bot=1 AND fi.bot IS NOT... | {"resultsets": [{"rowcount": 86, "headers": ["pl_from", "NS", "page_title", "L_titles", "#L", "SB", "IU", "CSD", "SR"]}], "runningtime": "0.62"} | null |
تضمينات القوالب المحذوفة | Query used by database report, using the SQL query found in https://github.com/mzmcbride/database-reports/blob/master/reports/general/deletedtrans.py | USE arwiki_p;
SELECT
CONVERT(tl_title USING utf8),
COUNT(DISTINCT tl_from)
FROM templatelinks
LEFT JOIN page AS p1
ON p1.page_namespace = tl_namespace
AND p1.page_title = tl_title
JOIN logging
ON tl_namespace = log_namespace
AND tl_title = log_title
AND log_type = 'delete'
JOIN page AS p2
ON tl_from = p2.page_id
WH... | {"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", "rc_logid", "rc_log_typ... | null |
zhwikt rc | null | USE zhwiktionary_p;
SELECT rc_id, rc_timestamp, rc_namespace, rc_title, rc_cur_id, page_namespace, page_title
FROM (
SELECT *
FROM recentchanges
WHERE rc_type = 6
AND rc_actor = 127
AND rc_title != "拉丁文"
ORDER BY rc_timestamp DESC
) rc
LEFT JOIN page ON page_id = rc_cur_id | {"resultsets": [{"rowcount": 67, "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_log_typ... | null |
Translators of board seat election pages per language and volume | For a given prefix of translatable pages, take all translators for the latest versions of translation units (otherwise someone fixing their own typos would look a prolific translator) and order them by language and translation volume. | use metawiki_p;
SELECT
actor_name as user,
substring_index(page_title, '/', -1) AS language,
count(*) AS no_translations,
CONCAT('* {{target | page = User:', actor_name, ' | site = meta.wikimedia.org}}') AS url
FROM
page
LEFT JOIN
-- Take only the latest revision of each translation to simplify
revision ON ... | {"resultsets": [{"rowcount": 24, "headers": ["rc_namespace", "page_is_redirect", "count"]}], "runningtime": "1.37"} | null |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('*[[:File:', page_title, ']]') AS wikitext FROM commonswiki_p.page JOIN commonswiki_p.categorylinks ON cl_from = page_id JOIN commonswiki_p.templatelinks ON tl_from = page_id WHERE page_namespace = 6 AND cl_to IN (SELECT page_title FROM commonswiki_p.categorylinks JOIN commonswiki_p.page ON cl_from = page... | {"resultsets": [{"rowcount": 1000, "headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page"]}], "runningtime": "3.90"} | null |
Translators at meta with language, number of translations | For a given prefix of translatable pages, take all translators for the latest versions of translation units (otherwise someone fixing their own typos would look a prolific translator) and order them by language and translation volume. | use metawiki_p;
SELECT
actor_name as user,
substring_index(page_title, '/', -1) AS language,
count(*) AS no_translations,
CONCAT('* {{target | page = User:', actor_name, ' | site = meta.wikimedia.org}}') AS url
FROM
page
LEFT JOIN
-- Take only the latest revision of each translation to simplify
revision ON ... | {"resultsets": [{"rowcount": 1000, "headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page"]}], "runningtime": "3.76"} | null |
WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2011_in_France",
"Images_from_W... | {"resultsets": [{"rowcount": 0, "headers": ["img_name"]}], "runningtime": "0.64"} | null |
WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT *
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2012_in_France"
)
| {"resultsets": [{"rowcount": 2642, "headers": ["number", "name"]}], "runningtime": "22.28"} | null |
Articles that are GA on some WikiProjects but not all | null | SELECT DISTINCT(page_title)
FROM page
JOIN page_assessments ON pa_page_id = page_id
WHERE page_namespace = 0
AND pa_class = 'GA'
AND EXISTS (
SELECT 1
FROM page_assessments
WHERE pa_page_id = page_id
AND pa_class != 'GA'
# Exclude Wikipedia 1.0, Spoken Wikipedia and Guild of Copy Editors
AND pa_project_id N... | {"resultsets": [{"rowcount": 1000, "headers": ["DOI"]}], "runningtime": "3.81"} | null |
Articles that are FA on some WikiProjects but not all | null | SELECT DISTINCT(page_title)
FROM page
JOIN page_assessments ON pa_page_id = page_id
WHERE page_namespace = 0
AND pa_class = 'FA'
AND EXISTS (
SELECT 1
FROM page_assessments
WHERE pa_page_id = page_id
AND pa_class != 'FA'
# Exclude Wikipedia 1.0, Spoken Wikipedia and Guild of Copy Editors
AND pa_project_id N... | {"resultsets": [{"rowcount": 1000, "headers": ["DOI", "frequency"]}], "runningtime": "93.14"} | null |
WLM-PL competition participants 2013-14 & 2017-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2017_in_Poland",
"Images_from_W... | {"resultsets": [{"rowcount": 881, "headers": ["actor_name", "edits"]}], "runningtime": "13.31"} | null |
GA/FA and GAN/FAC linked from September 14 | GA/FA and GAN/FAC linked from [[September 14]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 1, "headers": ["rev_parent_id"]}, {"rowcount": 5, "headers": ["rev_id", "rev_page", "rev_text_id", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1", "rev_content_model", "rev_content_format"]}], "runningtime": "0.33"} | null |
ar fix national teams title | null | use arwiki_p;
select DISTINCT
#CONCAT('{{subst:user:Mr._Ibrahem/قالب نقل|',page_title, '|', REPLACE(REPLACE(CONCAT( '' , page_title , '}}' )
#, 'الوطني_' , '' ) , 'للنساء' , 'للسيدات' )) AS t2
CONCAT('"',page_title, '":u"', page_title, '",' ) AS t2
from page
#where page_title like "%منتخب%الوطني%كرة_الماء... | {"resultsets": [{"rowcount": 59, "headers": ["sortie"]}], "runningtime": "2.90"} | null |
GA/FA and GAN/FAC linked from September 15 | GA/FA and GAN/FAC linked from [[September 15]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 11, "headers": ["page_title", "ll_title"]}], "runningtime": "5.99"} | null |
GA/FA and GAN/FAC linked from September 16 | GA/FA and GAN/FAC linked from [[September 16]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 48, "headers": ["linter_cat", "page_namespace", "count(*)"]}, {"rowcount": 9, "headers": ["linter_cat", "count(*)"]}, {"rowcount": 15, "headers": ["page_namespace", "count(*)"]}], "runningtime": "6.65"} | null |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('*[[:File:', page_title, ']]') AS wikitext FROM commonswiki_p.page JOIN commonswiki_p.categorylinks ON cl_from = page_id JOIN commonswiki_p.templatelinks ON tl_from = page_id WHERE page_namespace = 6 AND cl_to IN (SELECT page_title FROM commonswiki_p.categorylinks JOIN commonswiki_p.page ON cl_from = page... | {"resultsets": [{"rowcount": 2478, "headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page"]}], "runningtime": "11.03"} | null |
my newpagesvf | null | use arwiki_p;
SELECT *
#COUNT(r.rev_timestamp) AS num_articles
FROM revision r , actor a , page p
WHERE a.actor_name = 'Mr. Ibrahem'
and r.rev_actor = a.actor_id
and p.page_id = r.rev_page
#and p.page_is_redirect=0 #and r.rev_timestamp
#and p.page_namespace=14
#and r.rev_user_text = 'Mr.Ibrahembot'
and r.rev_parent... | {"resultsets": [{"rowcount": 10, "headers": ["rev_id", "rev_page", "rev_text_id", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1", "rev_content_model", "rev_content_format"]}, {"rowcount": 10, "headers": ["actor_id", "actor_user", "actor_name"]}], ... | null |
GA/FA and GAN/FAC linked from September 17 | GA/FA and GAN/FAC linked from [[September 17]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 0, "headers": ["cat1", "cat2"]}], "runningtime": "0.17"} | null |
Registrations of users who made 5+ edits in their first month (huwiki) | See https://quarry.wmflabs.org/query/38963 for 25+ edits.
See https://quarry.wmflabs.org/query/38965 for 100+ edits. | use huwiki_p;
SELECT
-- CONCAT(SUBSTR(user_registration, 1, 4), 'q', (SUBSTR(user_registration, 5, 2) - 1) DIV 3 + 1) AS registration_date,
CONCAT(SUBSTR(user_registration, 1, 4), '-', SUBSTR(user_registration, 5, 2)) AS registration_date,
count(*) AS new_users
FROM (
SELECT
user_id,
user_registration,
... | {"resultsets": [{"rowcount": 395, "headers": ["cl_from"]}], "runningtime": "1.26"} | null |
Registrations of users who made 25+ edits in their first month (huwiki) | See https://quarry.wmflabs.org/query/38962 for 5+ edits.
See https://quarry.wmflabs.org/query/38965 for 100+ edits. | use huwiki_p;
SELECT
-- CONCAT(SUBSTR(user_registration, 1, 4), 'q', (SUBSTR(user_registration, 5, 2) - 1) DIV 3 + 1) AS registration_date,
CONCAT(SUBSTR(user_registration, 1, 4), '-', SUBSTR(user_registration, 5, 2)) AS registration_date,
count(*) AS new_users
FROM (
SELECT
user_id,
user_registration,
... | {"resultsets": [{"rowcount": 224, "headers": ["actor_user", "actor_name", "cnt"]}], "runningtime": "41.35"} | null |
zhwikt: article title endswith "..." | null | USE zhwiktionary_p;
SELECT page_id, page_title
FROM page
WHERE page_title LIKE "%..."
AND page_namespace = 0 | {"resultsets": [{"rowcount": 101, "headers": ["CONCAT('# [[:File:', page_title, ']]')"]}], "runningtime": "5.47"} | null |
Registrations of users who made 100+ edits in their first month (huwiki) | See https://quarry.wmflabs.org/query/38962 for 5+ edits.
See https://quarry.wmflabs.org/query/38963 for 25+ edits. | use huwiki_p;
SELECT
-- CONCAT(SUBSTR(user_registration, 1, 4), 'q', (SUBSTR(user_registration, 5, 2) - 1) DIV 3 + 1) AS registration_date,
CONCAT(SUBSTR(user_registration, 1, 4), '-', SUBSTR(user_registration, 5, 2)) AS registration_date,
count(*) AS new_users
FROM (
SELECT
user_id,
user_registration,
... | {"resultsets": [{"rowcount": 536, "headers": ["page_title"]}], "runningtime": "20.15"} | null |
Wikimedia Commons users known to not be credited | Distinct usernames for {{Published|legal=no}} files, listed in https://commons.wikimedia.org/wiki/Category:Files_reused_by_external_parties_out_of_compliance_with_licensing_terms | USE commonswiki_p;
SELECT img_name, el_to, actor_name
FROM categorylinks
JOIN page t
ON cl_to = "Files_reused_by_external_parties_out_of_compliance_with_licensing_terms"
JOIN externallinks
ON t.page_id = el_from
AND cl_from = t.page_id
JOIN image
ON t.page_title = img_name
JOIN actor
ON img_actor = actor_id
JOIN page d... | {"resultsets": [{"rowcount": 0, "headers": ["File name", "Date", "Size", "Uploader's name"]}], "runningtime": "396.85"} | null |
GA/FA and GAN/FAC linked from September 18 | GA/FA and GAN/FAC linked from [[September 18]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 331, "headers": ["afa_filter", "afa_consequence", "afa_parameters"]}], "runningtime": "1.46"} | null |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('*[[:File:', page_title, ']]') AS wikitext FROM commonswiki_p.page JOIN commonswiki_p.categorylinks ON cl_from = page_id JOIN commonswiki_p.templatelinks ON tl_from = page_id WHERE page_namespace = 6 AND cl_to IN (SELECT page_title FROM commonswiki_p.categorylinks JOIN commonswiki_p.page ON cl_from = page... | {"resultsets": [{"rowcount": 1, "headers": ["page_title", "User", "Edits"]}], "runningtime": "0.90"} | null |
Count categories | null | SELECT COUNT(*) AS count_pages FROM page;
SELECT COUNT(*) AS count_cats FROM category;
SELECT COUNT(*) AS count_pages_like_math FROM page WHERE page_title LIKE '%math%';
SELECT COUNT(*) AS count_cats_like_math FROM category WHERE cat_title LIKE '%math%'; | {"resultsets": [{"rowcount": 100, "headers": ["page_title", "User", "Edits"]}], "runningtime": "18.01"} | null |
Hewiki fair use unused pictures 1 | null | use hewiki_p; select concat('# [[:קובץ:', replace(page_title, "_", " "), ']]') as Suspicious_file_title from page as p1 join image on exists
(select * from categorylinks as cl1 where cl_from = page_id and (cl_to = "ויקיפדיה_-_תמונות_שימוש_הוגן" or exists (select * from page as
p2 where p2.page_namespace = 14 and p2.pag... | {"resultsets": [{"rowcount": 2924, "headers": ["output"]}], "runningtime": "906.39"} | null |
שרי האלפים שרי המאות, בדיקה של יגאל וביקורת | null | use hewiki_p;
select user_name, count(page_title)
from user join revision_userindex join page join actor
on user_id = actor_user
and rev_page = page_id
and rev_actor = actor_id
where page_namespace = 0
and not page_is_redirect
and rev_parent_id = 0
and rev_deleted = 0
group by user_name
having count(page_title) >= 50
o... | {"resultsets": [{"rowcount": 1, "headers": ["actor_id", "actor_user", "actor_name"]}, {"rowcount": 10, "headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page"]}], "runningtime": "145.55"} | null |
Wikimedia Commons media with Czech description needing categories | null | SELECT CONCAT('*[[:File:', page_title, ']]') AS wikitext FROM commonswiki_p.page JOIN commonswiki_p.categorylinks ON cl_from = page_id JOIN commonswiki_p.templatelinks ON tl_from = page_id WHERE page_namespace = 6 AND cl_to IN (SELECT page_title FROM commonswiki_p.categorylinks JOIN commonswiki_p.page ON cl_from = page... | {"connection_id": 90112663} | null |
Disambiguated poets on Latin Wikipedia | Example query for User:Iustinus | select page_namespace, page_title from lawiki_p.page where page_title like '%_(poeta)'; | {"connection_id": 90184109} | null |
Disambiguated poets on Latin Wikipedia | Example query for User:Iustinus | select page_namespace, page_title from enwiktionary_p.page where page_title like '%plì'; | {"resultsets": [{"rowcount": 0, "headers": ["cl_from"]}], "runningtime": "0.43"} | null |
Disambiguated poets on Latin Wikipedia | Example query for User:Iustinus | select page_namespace, page_title from frwiktionary_p.page where page_title like '%plir'; | {"resultsets": [{"rowcount": 1394, "headers": ["number", "name"]}], "runningtime": "21.97"} | null |
GA/FA and GAN/FAC linked from September 20 | GA/FA and GAN/FAC linked from [[September 20]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 32, "headers": ["user", "edit_count"]}], "runningtime": "2.75"} | null |
Page titles containing “video” on huwiki | null | USE huwiki_p;
SELECT page_namespace, page_title FROM page WHERE LOWER(page_title) LIKE '%video%' AND page_is_redirect = 0; | {"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", "ll_from", "ll_lang", "ll_title"], "rowcount": 0}], "runningtime": "37.75"} | null |
Suspicious user root-page moves (Commons) | null | USE commonswiki_p;
select
log_id,
log_timestamp,
-- (select actor_name from actor where log_actor = actor_id) as "user",
actor_name as "user",
log_title,
log_params,(
select
comment_text
from
comment
where
comment_id = log_comment_id
) as "summary"
from
logging
JOIN actor... | {"resultsets": [{"rowcount": 248, "headers": ["page_title", "reverts"]}], "runningtime": "1.32"} | null |
css/js changes in the MediaWiki namespace by month (Commons) | null | USE commonswiki_p;
SELECT count(*), (select actor_name from actor where revactor_actor = actor_id) as "user", page_content_model, CONCAT(SUBSTR(rev_timestamp, 1, 4), '-', SUBSTR(rev_timestamp, 5, 2)) as jahr_monat
FROM revision, page
JOIN revision_actor_temp ON page_latest = revactor_rev
WHERE rev_page = page_id
... | {"resultsets": [{"headers": ["page_title", "pl_title", "rd_title", "rev_timestamp"], "rowcount": 520366}], "runningtime": "2659.63"} | null |
User page moves by users with low editcount | recentchanges on commonswiki | -- User moves by users with low editcount
USE commonswiki_p;
SELECT
DATE_FORMAT(rc_timestamp, "%b %d %Y %h:%i %p") AS ts,
REPLACE(rc_title, '_', ' ') AS oldname,
REPLACE(
SUBSTRING_INDEX(SUBSTRING_INDEX(rc_params, ';', 2), ':', -2),
'"',
' '
) AS newname,
rc_actor AS user_id,
u.user_editcount A... | {"resultsets": [{"headers": ["actor_name", "log_type", "log_action", "actions"], "rowcount": 294}], "runningtime": "7.59"} | null |
Extended-protected pages in fawiki without {{pp-%}} templates | null | use fawiki_p;
select distinct page_title
from page
join page_restrictions
on pr_page = page_id
join templatelinks
on tl_from = page_id
where tl_from_namespace = 0
and page_namespace = 0
and tl_namespace = 10
and tl_title not like ("pp-%")
and tl_title not in ("pp", "temporarily protected", "permanently protected")
and ... | {"resultsets": [{"rowcount": 123, "headers": ["Title", "user", "comment"]}], "runningtime": "2.46"} | null |
WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | WLM-UK competition participants 2013-14 & 2016-18, not active so far in 2019 | use commonswiki_p;
SELECT CONCAT("# {{#target:User_talk:", actor_name, "}}") as line
FROM revision r_prev
join categorylinks on rev_page = cl_from
join actor on rev_actor = actor_id and actor_user is not null
WHERE rev_parent_id = 0
and cl_to IN (
"Images_from_Wiki_Loves_Monuments_2013_in_the_United_States",
"Im... | {"resultsets": [{"headers": ["catlist"], "rowcount": 1}], "runningtime": "2.72"} | null |
Ownerless pages in the user space (Commons) | https://wikitech.wikimedia.org/wiki/Help:MySQL_queries#Ownerless_pages_in_the_user_space | USE commonswiki_p;
SELECT
page_namespace,
page_title,
page_len
FROM page
LEFT JOIN `user`
ON user_name = REPLACE(page_title, '_', ' ')
WHERE page_namespace IN (2,3)
AND page_is_redirect = 0
AND page_title NOT LIKE "%/%"
AND page_title NOT RLIKE "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0... | {"resultsets": [{"headers": ["page_title"], "rowcount": 530}], "runningtime": "6.96"} | null |
Image rotate requests by users with low editcount (recentchanges) | Commons | -- Rotate requests by users with low editcount
USE commonswiki_p;
SET max_statement_time = 300;
SELECT
CONCAT(
'# ', '[https://commons.wikimedia.org/w/index.php?title=File:',
rc.rc_title,
'&action=history',
' ', DATE_FORMAT(rev_timestamp, "%b %d %Y %h:%i %p"), ']'
) AS rev_link,
-- a.actor_name,... | {"resultsets": [{"rowcount": 30, "headers": ["page_title", "reverts"]}], "runningtime": "0.74"} | null |
en.wiki Timeless skin usage | null | use enwiki_p;
SELECT up_value AS skin, COUNT(*) FROM user_properties_anon WHERE up_property = 'skin' GROUP BY up_value; | {"resultsets": [{"headers": ["page_title", "reverts"], "rowcount": 30}], "runningtime": "3.30"} | null |
pages without revisions | null | use trwiki_p;
SELECT * FROM page
LEFT JOIN revision
ON rev_page = page_id
WHERE page_latest = 0 | {"resultsets": [{"headers": ["pl_from", "pl_namespace", "pl_title", "pl_from_namespace"], "rowcount": 32}], "runningtime": "14.09"} | null |
{{%/meta/color}} templates in enwiki and their interwiki links to fawiki | null | use enwiki_p;
select concat("الگو:", ll_title, "/meta/color") as Persian, page_title as English
from langlinks
join page
on ll_from = page_id
where ll_lang = "fa"
and page_title in
(
select replace(page_title, "/meta/color", "")
from page
where page_namespace = 10 -- Template
and page_title like "%/meta/color"... | {"resultsets": [{"headers": ["totale", "page_count_error", "weight"], "rowcount": 9}, {"headers": ["page_id", "page_title", "totale", "linter_params", "ptotale"], "rowcount": 481}], "runningtime": "5.81"} | null |
{{Taxonomy/%}} templates in enwiki and their interwiki links to fawiki | null | use enwiki_p;
select concat("الگو:Taxonomy/", page_title) as English, ll_title as Persian
from langlinks
join page
on ll_from = page_id
where ll_lang = "fa"
and page_title in
(
select replace(page_title, "Taxonomy/", "")
from page
where page_namespace = 10 -- Template
and page_title like "Taxonomy/%"
and pag... | {"resultsets": [{"rowcount": 27, "headers": ["page_title", "pl_title", "page_namespace", "pl_from_namespace", "page_id"]}], "runningtime": "127.87"} | null |
taWS aug 2019 | enWS PoM March 2015 edit-in-namespace detail summary | SELECT
edt.rev_user_text as 'Editor',
ndx.page_title as 'Work',
sum(edp.page_namespace = 104) as 'Page-space: edits',
sum(edp.page_namespace = 106) as 'Index-space: edits',
sum(edp.page_namespace = 0) as 'Main-space: edits',
COUNT(edp.page_id)-sum(edp.page_namespace in (0,104,106)) AS 'Other edi... | {"resultsets": [{"headers": ["cl_from", "cl_to", "cl_sortkey", "cl_timestamp", "cl_sortkey_prefix", "cl_collation", "cl_type"], "rowcount": 10}], "runningtime": "0.35"} | null |
GA/FA and GAN/FAC linked from September 25 | GA/FA and GAN/FAC linked from [[September 25]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"headers": ["CONCAT ('# [[',page_title,']]')"], "rowcount": 6}], "runningtime": "0.51"} | null |
GA/FA and GAN/FAC linked from September 21 | GA/FA and GAN/FAC linked from [[September 21]] | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND pg1.page_title IN ( #Where page is linked from a specified other page
SELECT
pl_title
FROM
pagelinks
WHERE
pl_from... | {"resultsets": [{"rowcount": 100, "headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page"]}], "runningtime": "1.88"} | null |
blue cyrillic letters cat in Commons | null | USE commonswiki_p;
SELECT CONCAT ('Category:',cl_to,'')
FROM categorylinks
WHERE cl_to in (select page_title from page where page_namespace=14) #blue cat ja kirillitsas
#AND (cl_to RLIKE '[Яя]' OR cl_to RLIKE '[Юю]') #RLIKE ei tööta, sest annab kõik kat
#А, Б, В, Г, Д, Е, Ё, Ж, З, И, Й, К, Л, М, Н, О, П, Р, С, Т, У, Ф,... | {"resultsets": [{"headers": ["page_title", "sum(revert_count)"], "rowcount": 0}], "runningtime": "0.20"} | null |
it.wiki articles without talk page | null | USE itwiki_p;
SELECT CONCAT( '# [[', page_title, ']]') FROM page pg
WHERE pg.page_is_redirect = 0
AND pg.page_namespace = 0
AND pg.page_id NOT IN (
SELECT tl_from
FROM templatelinks
WHERE tl_namespace = 10
AND tl_title = 'Disambigua'
)
AND pg.page_title NOT IN (
SELECT pg2.page_title FROM page pg2
WHERE pg2... | {"resultsets": [{"headers": ["page_title", "sum(revert_count)"], "rowcount": 0}], "runningtime": "0.20"} | null |
template and WD link test - Commons category: Dogs | null | use commonswiki_p;
SELECT DISTINCT pp.pp_value, p1.page_title, t1.tl_title, t2.tl_title
FROM categorylinks AS c1
JOIN page AS p1 ON c1.cl_from=p1.page_id AND p1.page_namespace=14 AND p1.page_is_redirect=0 AND p1.page_title = 'Dogs'
LEFT JOIN page_props AS pp ON pp.pp_page = p1.page_id AND pp.pp_propname = 'wikibase_ite... | {"resultsets": [{"headers": ["img_name"], "rowcount": 329}], "runningtime": "23.72"} | null |
template and WD link test - Commons category: Climate change conferences | null | use commonswiki_p;
SELECT DISTINCT pp.pp_value, p1.page_title, tl.tl_title, t2.tl_title
FROM categorylinks AS c1
JOIN page AS p1 ON c1.cl_from=p1.page_id AND p1.page_namespace=14 AND p1.page_is_redirect=0 AND p1.page_title = 'Climate_change_conferences'
LEFT JOIN page_props AS pp ON pp.pp_page = p1.page_id AND pp.pp_pr... | {"resultsets": [], "runningtime": "0.05"} | null |
empty NS1 @etwiki | null | use sowiki_p;
select CONCAT ('#[[arutelu:',page_title,']]')
from page AS p
where page_namespace = 1
and page_is_redirect = 0
AND page_len <3
LIMIT 199; | {"resultsets": [{"headers": ["page_title", "page_latest", "tl_title", "tl_namespace"], "rowcount": 238}], "runningtime": "3.62"} | null |
{{%/meta/shortname}} templates in enwiki and their interwiki links to fawiki | null | use enwiki_p;
select concat("الگو:", ll_title, "/meta/shortname") as Title, replace(ll_title, "(", "(براییی") as Content
from langlinks
join page
on ll_from = page_id
where ll_lang = "fa"
and page_title in
(
select replace(page_title, "/meta/shortname", "")
from page
where page_namespace = 10 -- Template
and p... | {"resultsets": [{"rowcount": 15, "headers": ["project_page", "rev_timestamp"]}], "runningtime": "0.20"} | null |
{{%/meta/shortname}} templates in enwiki and their interwiki links to fawiki | null | use enwiki_p;
select concat("الگو:", ll_title, "/meta/shortname") as Title, replace(ll_title, "(", "(براییی") as Content
from langlinks
join page
on ll_from = page_id
where ll_lang = "fa"
and page_title in
(
select replace(page_title, "/meta/shortname", "")
from page
where page_namespace = 10 -- Template
and p... | {"resultsets": [{"rowcount": 223, "headers": ["page_title", "page_latest", "tl_title", "tl_namespace"]}], "runningtime": "2.81"} | null |
Bad disambiguation page titles (eswiki) | Disambiguation pages with a superfluous " (desambiguación)" suffix (eswiki). | use eswiki_p;
select page_title as main_title
from (page join redirect on page_id = rd_from)
where page_namespace = 0 and rd_title = concat(page_title, '_(desambiguación)');
| {"resultsets": [{"rowcount": 6994, "headers": ["page_title"]}], "runningtime": "206.70"} | null |
All New Page Reviewer (including null) activity since July 8th 2018 (excluding admins) | NPR activity for all reviewers since July 8th 2018 (last 6 months)
| SELECT t1.reviewer, reviews, `last review` FROM
(
SELECT logtemp.log_user_text AS `reviewer`,
COUNT(logtemp.log_page) AS `reviews`
FROM (
SELECT log_user_text, log_page
FROM logging_userindex
JOIN user_groups ON ug_user = log_user
WHERE log_timestamp BETWEEN 20180922000000 AND NOW()
AND log_type = 'pag... | {"connection_id": 91887699} | null |
Navseasoncats | null | SELECT DISTINCT
CONCAT('تصنيف:',arwiki_p.page.page_title,'') AS aa ,
CONCAT('Category:',enwiki_p.page.page_title,'') AS vv , ll.ll_title
FROM enwiki_p.page
JOIN arwiki_p.page
#ON arwiki_p.page.page_title = enwiki_p.page.page_title
ON arwiki_p.page.page_namespace = enwiki_p.page.page_namespace
LEFT JO... | {"resultsets": [{"headers": ["rc_title", "rc_timestamp", "rc_this_oldid", "rc_last_oldid", "actor_name", "rc_comment", "rc_old_len", "rc_new_len", "rc_new_len-rc_old_len"], "rowcount": 137}], "runningtime": "2.68"} | null |
templatedata in arwikihttps://quarry.wmflabs.org/query/39144# | use lvwiki_p;
SELECT page_title, (SELECT count(*) FROM templatelinks WHERE tl_title = page_title AND tl_namespace = 10) as transclusions
FROM page_props
JOIN page ON page_id = pp_page and page_is_redirect=0
WHERE pp_propname = 'templatedata' AND page_namespace = 10 AND page_title NOT LIKE '%/doc' | use arwiki_p;
SELECT page_title, (SELECT count(*) FROM templatelinks WHERE tl_title = page_title AND tl_namespace = 10) as transclusions
FROM page
WHERE page_is_redirect=0 and page_namespace=10 AND page_title NOT LIKE '%/شرح'
and page_id not in (select pp_page from page_props where pp_propname = 'templatedata') | {"resultsets": [{"rowcount": 19539, "headers": ["pp_value", "page_title", "tl_namespace", "tl_title"]}], "runningtime": "964.21"} | null |
Article creations by user | null | SET STATEMENT max_statement_time = 60 FOR
SELECT actor_name, SUM(1-page_is_redirect) as Non_Redirects, SUM(page_is_redirect) as Redirects
FROM logging_logindex
JOIN actor_logging ON actor_id=log_actor
JOIN page ON page_id=log_page
WHERE log_namespace=0 AND log_type = 'create' AND log_action='create'
AND log_timestamp >... | {"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}], "runningtime": "0.18"} | null |
it.wiki articles without talk page | null | USE itwiki_p;
SELECT CONCAT( '# [[', page_title, ']]') FROM page pg
WHERE pg.page_is_redirect = 0
AND pg.page_namespace = 0
AND pg.page_id NOT IN (
SELECT tl_from
FROM templatelinks
WHERE tl_namespace = 10
AND tl_title = 'Disambigua'
)
AND pg.page_title NOT IN (
SELECT pg2.page_title FROM page pg2
WHERE pg2... | {"resultsets": [{"rowcount": 1, "headers": ["COUNT(*)"]}], "runningtime": "0.31"} | null |
[[WP:MOSTARTICLES]] | For [[en:w:WP:RAQ]] circa 23 Sep 2019. | SELECT
actor_name AS 'User',
SUM(1 - page_is_redirect) AS 'Non-redirects',
SUM(page_is_redirect) AS 'Redirects',
COUNT(*) AS 'Total'
FROM revision_userindex
JOIN page ON page_id = rev_page
JOIN actor_revision ON actor_id = rev_actor
WHERE rev_parent_id = 0
AND page_namespace = 0
GROUP BY 'User'
ORDER BY 'Total' ... | {"resultsets": [{"headers": ["actor_user", "actor_name", "cnt"], "rowcount": 226}], "runningtime": "29.25"} | null |
GA/FA and GAN/FAC search | GA/FA and GAN/FAC African-Americans in business | SELECT
page_title #Faster than just selecting the page title and id, but only those are needed
FROM
page pg1
WHERE
pg1.page_namespace = 0 #Only care about articles
AND (#AND the page is in specified categories
(
pg1.page_id IN ( #Page is in specified categories
SELECT
cl_from
... | {"connection_id": 92605894} | null |
Ruwiki templates with maximum amount of links | null | USE ruwiki_p;
SELECT
page_title,
COUNT(*) AS number
FROM pagelinks
JOIN page ON pl_from = page_id
WHERE pl_from_namespace = 10
AND pl_namespace = 0
GROUP BY page_title
ORDER BY number DESC; | {"resultsets": [{"headers": ["CONCAT('# [[:File:', page_title, ']]')"], "rowcount": 1}], "runningtime": "8.24"} | null |
Revision Deletion Decisions | Look for revision deletions and group them by the full comment field. | SELECT count(*) FROM page JOIN revision ON page.page_id = revision.rev_page; | {"resultsets": [{"headers": ["CONCAT('# [[:File:', page_title, ']]')"], "rowcount": 0}], "runningtime": "1.84"} | null |
980701 mp1 # of redirected links to DAB pages (pages) | null | USE fawiki_p;
SELECT COUNT(pl_title)
FROM pagelinks
LEFT JOIN page ON pl_namespace = page_namespace AND pl_title = page_title
LEFT JOIN redirect ON page_id = rd_from
WHERE page_is_redirect = 1
AND page_namespace = 0
AND rd_namespace = 0
AND pl_from IN (
SELECT page_id
FROM page
WHERE page_is_redirect=0
AND ... | {"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}], "runningtime": "0.29"} | null |
980701 mp1 # of DAB pages with redirected link (pages) | null | USE fawiki_p;
SELECT COUNT(DISTINCT(page_title))
FROM pagelinks
LEFT JOIN page ON pl_namespace = page_namespace AND pl_title = page_title
LEFT JOIN redirect ON page_id = rd_from
WHERE page_is_redirect = 1
AND page_namespace = 0
AND rd_namespace = 0
AND pl_from IN (
SELECT page_id
FROM page
WHERE page_is_redir... | {"connection_id": 18871547} | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.