title stringlengths 1 212 | description stringlengths 1 4.39k ⌀ | query stringlengths 1 65.5k ⌀ | extra_info stringlengths 18 31.6k | wikidb stringlengths 4 26 ⌀ |
|---|---|---|---|---|
Edit activitity of internal page links from a page | null | SELECT
user_name,
COUNT(*) as edits,
MAX(LEFT(rev_timestamp,8)) as latest_edit_date
page_id
FROM page
Where page_namespace=0 AND page_title IN (
SELECT pl_title
FROM page, pagelinks
Where page_title='ఆంధ్రప్రదేశ్' AND
pl_from_namespace = 0
AND pl_from =page_id AND pl_namespace=0)
JOIN revision ... | {"resultsets": [{"headers": ["rev_actor", "actor_name", "articles_created"], "rowcount": 100}], "runningtime": "1.05"} | tewiki_p |
Edit activitity of main namespace page links from a page | Identify top editors of a page (more than 4 edits) and its internal links to main namespace. Helps in strengthening the team contributing to a prominent article and its links | SELECT
CONCAT("[[User:",user_name,"|",user_name,"]], ") as userlink
FROM revision
JOIN page ON revision.rev_page = page.page_id
JOIN revision_actor_temp
ON revactor_rev=rev_id
JOIN actor
ON revactor_actor=actor_id
JOIN user
ON user_id =actor_user
WHERE LEFT(rev_timestamp,8) >= REPLACE(CURDATE() - ... | {"resultsets": [{"headers": ["page_title", "rev_timestamp"], "rowcount": 4}], "runningtime": "27.56"} | tewiki_p |
Vandalismebestrijding nlwiki | IP patrolling (vandalismebestrijding), 287 unpatrolled, 5 maart 2022, 14:00 (CET) | # anonymous edits totals
SELECT
CASE rc_patrolled
WHEN 0 THEN 'unpatrolled'
WHEN 1 THEN 'manually patrolled'
WHEN 2 THEN 'autopatrolled'
END AS rc_patrolled,
COUNT(*) AS 'count'
FROM recentchanges, actor
WHERE rc_actor=actor_id AND actor_user IS NULL
GROUP BY rc_patrolled
UNION
SELECT 'total... | {"resultsets": [{"headers": ["page_title", "pl_title"], "rowcount": 699}], "runningtime": "3.84"} | nlwiki_p |
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": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %"], "rowcount": 38}], "runningtime": "8.94"} | eswiki |
MassMassage list creator:Active user of Kannada Wikisource NS0 & NS104 | MassMassage list creator:Active user of Indic Wikisource, here NS:0 an NS:104 ( Main namespace and Page namespace) edit done by the user account | USE knwikisource_p;
SELECT
CONCAT("# {{target | user =",actor_name,"| site = kn.wikisource.org }}") AS rev_user_text,
COUNT(actor_id) AS recent_user_editcount
/*user_editcount*/
FROM revision
JOIN actor ON rev_actor=actor_id
JOIN page ON rev_page=page_id
WHERE actor_user IS NOT NULL
AND page_namespace IN (0)
AND re... | {"connection_id": 27947879} | knwikisource_p |
Malayalam description stating with "ഒരു..." | null | USE wikidatawiki_p;
SELECT wbit_item_id, wbx_text
FROM wbt_item_terms
JOIN wbt_term_in_lang ON wbit_term_in_lang_id = wbtl_id
JOIN wbt_type ON wbtl_type_id = wby_id
JOIN wbt_text_in_lang ON wbtl_text_in_lang_id = wbxl_id
JOIN wbt_text ON wbxl_text_id = wbx_id
LEFT JOIN enwiki_p.wbc_entity_usage ON eu_en... | {"resultsets": [{"headers": ["rank", "IFNULL(actor_name, '\u0412\u0441\u044c\u043e\u0433\u043e')", "created", "total_len", "articles"], "rowcount": 35}], "runningtime": "0.24"} | wikidatawiki_p |
All pages in article name space with zwnj | All page titles which contain ZWNJ ( 0xE2808C)
| SELECT
actor_name,
page_id,
REPLACE(page_title, '_', ' ') as pagename,
LEFT(rev_timestamp,8) as date
from page p
join revision ON rev_page = p.page_id AND rev_parent_id = 0 AND p.page_namespace=0
join actor ON actor_id=rev_actor
# where page_title ='బిశ్వ_భూషణ్_హరిచందన్'
where HEX(page_titl... | {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}], "runningtime": "2.01"} | tewiki_p |
Tennis lint - Missing end tag | null | select distinct page_title
, linter_params
from linter
join page on page.page_id = linter.linter_page
where page.page_namespace=0 and linter_cat=4 and linter_params like '%ennis%' and linter_params like '%"name":"b"%'
order by page_title asc
limit 1000; | {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}], "runningtime": "1.88"} | enwiki |
All articles with zwnj followed by space excl. redirects, disamb | All page titles which contain ZWNJ ( 0xE2808C) followed by space excl. redirects and titles with disambiguation parenthesis item
| SELECT
actor_name,
page_id,
REPLACE(page_title, '_', ' ') as pagename,
LEFT(rev_timestamp,8) as date
from page p
join revision ON rev_page = p.page_id AND rev_parent_id = 0 AND p.page_namespace=0 AND page_is_redirect =0
join actor ON actor_id=rev_actor
# where page_title ='బిశ్వ_భూషణ్_హరిచందన... | {"resultsets": [{"headers": ["rc_patrolled", "count"], "rowcount": 4}, {"headers": ["user", "unpatrolled"], "rowcount": 10}, {"headers": ["day", "unpatrolled", "manually patrolled", "autopatrolled", "total"], "rowcount": 31}, {"headers": ["rc_namespace", "unpatrolled"], "rowcount": 4}, {"headers": ["rc_namespace", "rc_... | tewiki_p |
Get page_id | null | Select page_id
From page
# where page_title ='బిశ్వ_భూషణ్_హరిచందన్'
where REPLACE(page_title,"_"," ") ='బిశ్వభూషణ్ హరిచందన్' | {"resultsets": [{"headers": ["editor", "accepts", "recent_edits"], "rowcount": 1714}], "runningtime": "15.99"} | tewiki_p |
All pages with link to redirect file | All pages which link to redirect page (possibly contain ZWNJ ( 0xE2808C)), specify it
| Select
CONCAT('[[',IF(p.page_namespace=10,"మూస:",""),p.page_title,"]]") as pagetofix
FROM
(
SELECT
pl_namespace,
pl_from,
pl_from_namespace,
pl_title
from pagelinks ) as pls
JOIN
(Select page_id, page_title, page_namespace
From page
) as p
# where page_title ='బిశ్వ_భూషణ్_హరిచందన్'
ON pls.... | {"resultsets": [{"headers": ["page_title"], "rowcount": 10}], "runningtime": "0.08"} | tewiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-israel | 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 ... | {"resultsets": [{"headers": ["blocks", "actor_name"], "rowcount": 181}], "runningtime": "20.59"} | commonswiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-iran | 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 ... | {"resultsets": [{"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 10}], "runningtime": "0.06"} | commonswiki_p |
Show all queriable public databases | Displays a list of the public WMFLabs databases that can be queried through Quarry. There is one database per language and project. | SHOW TABLES; | {"resultsets": [{"headers": ["ss_total_edits"], "rowcount": 1}, {"headers": ["SUM(user_editcount)"], "rowcount": 1}, {"headers": ["user_id", "user_name", "user_editcount", "user_admin", "user_bot"], "rowcount": 804}], "runningtime": "6.36"} | enwiki |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-bolivia | 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 ... | {"resultsets": [{"headers": ["pages_with_disambig_but_not_redir"], "rowcount": 1}, {"headers": ["user_id", "user_name", "user_articles", "user_latestcreation"], "rowcount": 1003}], "runningtime": "122.80"} | commonswiki_p |
phaegopterina gaps | null | WITH gapped AS
(
SELECT page_id, page_title, page_random, page_random - (LAG(page_random) OVER (ORDER BY page_random)) AS gap
FROM page
WHERE page_namespace=0 AND page_is_redirect=0 AND
-- page_random >= 0.72 AND page_random <= 0.725 AND -- limit to an arbitrary small subset of pages for query testing
-- exclude d... | {"resultsets": [{"headers": ["rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1"], "rowcount": 7}], "runningtime": "0.07"} | enwiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-georgia | 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 ... | {"resultsets": [{"headers": ["rev_parent_id", "page_title", "actor_name"], "rowcount": 1046}], "runningtime": "35.66"} | commonswiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-venezuela | 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 ... | {"resultsets": [{"headers": ["page_title", "rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1"], "rowcount": 830}], "runningtime": "10.93"} | commonswiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-uruguay | 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 ... | {"connection_id": 8273501} | commonswiki_p |
-WMF users on Meta | Example for finding organizational accounts. See https://quarry.wmcloud.org/query/51523 for a more general example (not specific to a single wiki) that also indicates whether account still active or not. | SELECT
user_name,
user_registration,
user_editcount
FROM user
WHERE
user_name LIKE "%-WMF%"
ORDER BY
user_name ASC | {"resultsets": [{"headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page", "actor_id", "actor_user", "actor_name"], "rowcount": 5}], "runningtime": "0.08"} | metawiki_p |
page_random gaps | null | SELECT page_id, page_title, page_random, page_random - (LAG(page_random) OVER (ORDER BY page_random)) AS gap
FROM page
WHERE page_namespace=0 AND page_is_redirect=0 AND
-- page_random >= 0.5 AND page_random <= 0.51 AND -- limit to an arbitrary small subset of pages for query testing
-- exclude dab pages
NOT EXIST... | {"resultsets": [{"headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page", "rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_... | enwiki_p |
Longest 1,000 pages (User) | null | SELECT page_title AS "User", page_len AS "Size (bytes)"
FROM page WHERE page_namespace = "2" ORDER BY page_len DESC LIMIT 1000; | {"resultsets": [{"headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page", "rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_... | enwiki_p |
Longest 1,000 pages (User talk) | null | SELECT page_title AS "User talk", page_len AS "Size (bytes)"
FROM page WHERE page_namespace = "3" ORDER BY page_len DESC LIMIT 1000; | {"resultsets": [{"headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page", "rev_id", "rev_page", "rev_comment_id", "rev_actor", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_... | enwiki_p |
Sources of External Links | null | select * from externallinks
limit 100
| {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}, {"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 105}], "runningtime": "5.25"} | enwiki |
Daily number of edits on cswiki (using actor table) | null | set @begin = '20210101000000', @end = '20220101000000';
select date(date_add(rev_timestamp, interval 2 hour)) as date, count(*) as edits from revision left join actor on rev_actor = actor_id left join user_groups on actor_user = ug_user and ug_group = 'bot' where ug_user is null and rev_timestamp between 0+date_sub(@be... | {"resultsets": [{"headers": ["page_title"], "rowcount": 3444}], "runningtime": "5.38"} | cswiki_p |
Rolling number of edits (7 days) on cswiki (using actor table) | Bots excluded. When forking, please adapt wiki and dates at the top. | use cswiki_p;
set @begin = '20210101000000', @end = '20220101000000';
select date, count(*) as edits from (
select date(date_add(rev_timestamp, interval 2 hour)) as date from revision left join actor on rev_actor = actor_id left join user_groups on actor_user = ug_user and ug_group = 'bot' where ug_user is null and r... | {"resultsets": [{"headers": ["log_type", "log_action", "actor_name", "AAAA", "Total"], "rowcount": 4814}], "runningtime": "7.15"} | cswiki_p |
Wikidata items with most links | null | SELECT ips_item_id, COUNT(*)
FROM wb_items_per_site
GROUP BY ips_item_id
ORDER BY COUNT(*) DESC
LIMIT 10; | {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}, {"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 87}], "runningtime": "3.71"} | wikidatawiki_p |
Wikidata items with most links but no English | null | null | {"resultsets": [{"headers": ["CONCAT('# [[',REPLACE(page_title,'_',' '),']]')"], "rowcount": 160}], "runningtime": "171.71"} | wikidatawiki_p |
تصحيح تصنيفات | null | use arwiki_p;
select CONCAT('* [[:تصنيف:',page_title, ']]>') AS cat1
, REPLACE(CONCAT('[[:تصنيف:', page_title, ']]'), 'هيئة_تدريس' , 'أعضاء_هيئة_تدريس' ) as cat2
from page
where page_namespace=14 and page_is_redirect=0 and (page_title like "هيئة_تدريس%")
and page_title not like "%/%"
and page_title not like "%هيئة_... | {"resultsets": [{"headers": ["article", "portal"], "rowcount": 0}], "runningtime": "18.59"} | arwiki |
تصحيح تصنيفات | null | use arwiki_p;
select CONCAT('* [[:تصنيف:',page_title, ']]>') AS cat1
, REPLACE(CONCAT('[[:تصنيف:', page_title, ']]'), 'هيئات_تدريسية' , 'أعضاء_هيئات_تدريس' ) as cat2
from page
where page_namespace=14 and page_is_redirect=0 and (page_title like "هيئات_تدريسية%")
and page_title not like "%/%"
and page_title not like ... | {"resultsets": [{"headers": ["site_id", "site_global_key", "site_type", "site_group", "site_source", "site_language", "site_protocol", "site_domain", "site_data", "site_forward", "site_config"], "rowcount": 1}], "runningtime": "0.07"} | arwiki |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-chile | 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 ... | {"resultsets": [{"headers": ["page_title"], "rowcount": 1452}], "runningtime": "1960.32"} | commonswiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-norway | 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 ... | {"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": ["page_title"], "rowcount": ... | commonswiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-greece | 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 ... | {"resultsets": [{"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["tl_title"], "rowcount": 0}, {"headers": ["page_title", "rev_timestamp"], "rowcount": 1}, {"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title", "pp_propname"], "r... | commonswiki_p |
Authors of good articles | null | select page_title, actor_name from revision join page on page_id=rev_page join actor on rev_actor=actor_id where rev_parent_id=0 and page_namespace=0 and rev_page in (select cl_from from categorylinks where cl_to="Wikipedie:Dobré_články"); | {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}, {"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}], "runningtime": "3.20"} | cswiki_p |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-tunisia | 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 ... | {"resultsets": [{"headers": ["el_from", "page_title", "el_to"], "rowcount": 52881}], "runningtime": "436.35"} | commonswiki_p |
Vandalismebestrijding nlwiki | IP-controle: 863 open, 8 maart 2022m 15:05 (CET) | # anonymous edits totals
SELECT
CASE rc_patrolled
WHEN 0 THEN 'unpatrolled'
WHEN 1 THEN 'manually patrolled'
WHEN 2 THEN 'autopatrolled'
END AS rc_patrolled,
COUNT(*) AS 'count'
FROM recentchanges, actor
WHERE rc_actor=actor_id AND actor_user IS NULL
GROUP BY rc_patrolled
UNION
SELECT 'total... | {"resultsets": [{"headers": ["concat(\"Category:\",page_title)", "page_len", "cat_pages", "cat_subcats"], "rowcount": 8377}], "runningtime": "19.27"} | nlwiki_p |
Page table test 2 | null | select page_title, actor_name, count(actor_name) as num_edits
from page, revision, actor, user
where page_id=rev_page
and rev_actor=actor_id and actor_user=user_id
and (page_title = 'Street_layout_of_Seattle' or page_title = 'Pike_Street' ) /* Bri=>13 for Street layout, => 45 for Pike */
group by actor_name; /* page t... | {"resultsets": [{"headers": ["actor_name"], "rowcount": 2565}], "runningtime": "1078.28"} | enwiki |
Mainspace "portal" redirects on enwiki | null | SELECT page_title, rd_namespace, rd_title
FROM page
INNER JOIN redirect ON page_id = rd_from
WHERE (page_title LIKE "Portal\_%"
OR page_title LIKE "%\_Portal"
OR page_title LIKE "%\_portal")
AND page_namespace = 0 | {"resultsets": [{"headers": ["page_title", "DATE_FORMAT(rev_timestamp,'%Y %m %d')"], "rowcount": 38}], "runningtime": "0.10"} | enwiki_p |
portal redirects from mainspace to elsewhere on enwiki | null | SELECT page_title, rd_namespace, rd_title
FROM page
INNER JOIN redirect ON page_id = rd_from
WHERE (page_title LIKE "Portal\_%"
OR page_title LIKE "%\_Portal"
OR page_title LIKE "%\_portal")
AND page_namespace = 0
AND rd_namespace != 0 | {"resultsets": [{"headers": ["page_title", "DATE_FORMAT(rev_timestamp,'%Y-%m-%d')"], "rowcount": 38}], "runningtime": "0.12"} | enwiki_p |
luckiest enwiki articles | enwiki mainspace articles with values of page_random which are well-spaced from the next-smallest value. These are the articles that are most likely to be reached when hitting the "Random article" button. | SELECT page_id, page_title, page_random, page_random - (LAG(page_random) OVER (ORDER BY page_random)) AS gap
FROM page
WHERE page_namespace=0 AND page_is_redirect=0 AND
-- page_random >= 0.5 AND page_random <= 0.51 AND -- limit to an arbitrary small subset of pages for query testing
-- exclude dab pages
NOT EXIST... | {"resultsets": [{"headers": ["page_title", "concat(\" [[\", p.page_title, \"]] \")", "concat(\" [[Talk:\", p.page_title, \"]] \")"], "rowcount": 100}], "runningtime": "18.33"} | enwiki_p |
Page table test with editcount | null | set @EDITCOUNT_MIN=10;
select page_title, actor_name, count(actor_name) as num_edits
from page, revision, actor, user
where page_id=rev_page
and rev_actor=actor_id and actor_user=user_id
and user_editcount < @EDITCOUNT_MIN
and (page_title = 'Street_layout_of_Seattle' or page_title = 'Pike_Street' ) /* Bri=>13 for Str... | {"connection_id": 29373614} | enwiki |
Page table test with editcount elegant pages | null | null | {"resultsets": [{"headers": ["page_title"], "rowcount": 28}], "runningtime": "7.51"} | enwiki |
Page table test with editcount or IP | null | set @EDITCOUNT_MIN=10;
select actor_name as editor, count(actor_name) as num_edits
from page, revision, actor
where page_id=rev_page
and rev_actor=actor_id and actor_user is null
and page_title in ('Street_layout_of_Seattle','Pike_Street' ) /* Bri=>13 for Street layout, => 45 for Pike */
union
select actor_name, coun... | {"resultsets": [{"headers": ["page_title"], "rowcount": 435}], "runningtime": "5.23"} | enwiki |
Number of Russian lexemes per user | null | select actor_name, count(*) c
from revision_userindex
join page on rev_page=page_id
join actor_revision on rev_actor=actor_id
JOIN pagelinks ON page.page_id=pagelinks.pl_from
where page_namespace = 146
AND pagelinks.pl_title="Q7737" # French
group by actor_user
order by c desc;
| {"resultsets": [{"headers": ["ss_total_edits"], "rowcount": 1}, {"headers": ["SUM(user_editcount)"], "rowcount": 1}, {"headers": ["user_id", "user_name", "user_editcount", "user_admin", "user_bot"], "rowcount": 804}], "runningtime": "6.45"} | wikidatawiki_p |
Page table test with editcount or IP using join | null | set @EDITCOUNT_MIN=10;
select actor_name as editor, count(actor_name) as num_edits
#works1 from page, revision
#works1 join actor on rev_actor=actor_id and actor_user is null
from page, revision, user
join actor on revision.rev_actor=actor_id and (actor_user is NULL or (actor_user is not null and actor_user=user_id ... | {"resultsets": [{"headers": ["linter_cat", "page_namespace", "count(*)"], "rowcount": 70}, {"headers": ["linter_cat", "count(*)", "count(distinct page_namespace)"], "rowcount": 13}, {"headers": ["page_namespace", "count(*)", "count(distinct linter_cat)"], "rowcount": 19}], "runningtime": "0.27"} | enwiki |
Oli editors 1 | null | set @EDITCOUNT_MIN=100;
select actor_name as editor, count(actor_name) as num_edits
from page, revision, actor
where page_id=rev_page
and rev_actor=actor_id and actor_user is null
#and page_title in ('Igor_Sechin','Kirill_Shamalov','Petr_Fradkov','Gennady_Timchenko')
and page_id in (9369926, 8825193, 489... | {"resultsets": [{"headers": ["pagename"], "rowcount": 16}], "runningtime": "0.15"} | enwiki |
orphaned talks | null | SELECT
page_namespace,
page_id,
page_title,
page_is_redirect,
page_len
... | {"resultsets": [{"headers": ["page_title", "number"], "rowcount": 36221}], "runningtime": "44.08"} | enwiki_p |
Oli editors blocks 2 | null | set @EDITCOUNT_MIN=100;
set @BLOCKPAGES='9369926,8825193,48956967,70144271'; #'Igor_Sechin','Kirill_Shamalov','Petr_Fradkov','Gennady_Timchenko'
select actor_name as editor, count(actor_name) as num_edits, "no" as block, "" as reason
from page, revision, actor
where page_id=rev_page
and rev_actor=actor_id and... | {"resultsets": [{"headers": ["pl_from", "number"], "rowcount": 36221}], "runningtime": "39.41"} | enwiki |
Oli editors blocks | null | # ------------------------------------------------------------------------------------------------------------------
# | This SQL query will return the status of IPs/registered editors to a selected set of Wikipedia pages on enwiki.
# | Editors with more than EDITCOUNT_MIN edits will not be examined.
# | Due to technic... | {"resultsets": [{"headers": ["page_title", "cl_to"], "rowcount": 24}], "runningtime": "13.09"} | enwiki |
Oli editors blocks | null | # ------------------------------------------------------------------------------------------------------------------
# | This SQL query will return the status of IPs/registered editors to a selected set of Wikipedia pages on enwiki.
# | Editors with more than EDITCOUNT_MIN edits will not be examined.
# | Due to technic... | {"resultsets": [{"headers": ["page_title", "page_id", "revisions", "editors", "size", "created"], "rowcount": 100}], "runningtime": "21.19"} | enwiki |
Oli page IDs | null | #top 20 at enwiki "List of Russian billionaires"
#plus 2022 US sanctioned Igor Sechin, Kirill Shamalov, Petr Fradkov (Gennady Timchenko is #6 in tp 20)
select page_id, page_title
from page
where page_title in ('Alexei_Mordashov','Vladimir_Potanin','Vladimir_Lisin','Vagit_Alekperov','Leonid_Mikhelson','Gennady_Tim... | {"resultsets": [{"headers": ["user_name", "user_editcount"], "rowcount": 2}], "runningtime": "0.05"} | enwiki |
Oli page IDs 2 | null | #top 20 at enwiki "List of Russian billionaires"
#plus 2022 US sanctioned Igor Sechin, Kirill Shamalov, Petr Fradkov (Gennady Timchenko is #6 in tp 20)
select page_id, page_title
from page
where page_title in ('Alisher_Usmanov','Arkady_Rotenberg','Boris_Rotenberg','Igor_Shuvalov','Internet_Research_Agency','Yevge... | {"resultsets": [{"headers": ["ar_id", "ar_namespace", "ar_title", "ar_timestamp", "ar_minor_edit", "ar_page_id"], "rowcount": 2018}], "runningtime": "23.20"} | enwiki |
Oli editors blocks 4 | null | # ------------------------------------------------------------------------------------------------------------------
# | This SQL query will return the status of IPs/registered editors to a selected set of Wikipedia pages on enwiki.
# | Editors with more than EDITCOUNT_MIN edits will not be examined.
# | Due to technic... | {"connection_id": 29903998} | enwiki |
Oli editor blocks 5 | null | # Simplified query to focus on blocked editors.
# The page_id list can be manually compiled by looking at page id under "page information" in the Wiki web interface,
# or by running Quarry query #62940 with a list of titles.
select page_title as 'page title', actor_name as editor, count(actor_id) as N, comment_... | {"resultsets": [{"headers": ["actor_name", "date", "pagename"], "rowcount": 213}], "runningtime": "0.41"} | enwiki |
(TOTAL) SDC edits by user and edit summary #WMSE-WLM-panama | 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 ... | {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 0}, {"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}], "runningtime": "2.59"} | commonswiki_p |
Uploads of mine that are CC * 3.0 but not 4.0 | null | SELECT page_title, tl1.tl_title
FROM page
JOIN pagelinks -- links to my user page (probably uploaded by me, false positives could be reviewed manually)
ON page_id = pl_from
AND pl_from_namespace = 6 -- NS_FILE
AND pl_namespace = 2 -- NS_USER
AND pl_title = 'Nortix08'
JOIN templatelinks AS tl1 -- transcludes any CC ... | {"resultsets": [{"headers": ["pl_from", "pl_title"], "rowcount": 12}], "runningtime": "12.91"} | commonswiki_p |
userpage as template | null | SELECT *
FROM templatelinks
WHERE tl_namespace = 2
AND (tl_from_namespace = 4 OR tl_from_namespace % 2 = 1) | {"resultsets": [{"headers": ["page_title", "cl_to"], "rowcount": 31}], "runningtime": "1.95"} | zhwiki_p |
WikiProject XNRs on enwiki | null | SELECT page_title, rd_namespace, rd_title
FROM page
INNER JOIN redirect ON page_id = rd_from
WHERE page_namespace = 0
AND rd_namespace = 4
AND rd_title LIKE "WikiProject%"
AND rd_title NOT LIKE "%/%" | {"resultsets": [{"headers": ["editor", "accepts", "recent_edits"], "rowcount": 1714}], "runningtime": "12.06"} | enwiki_p |
Edit activitity of main namespace page links from a page -exp | Identify top editors of a page and its internal links to main namespace. Helps in strengthening the team contributing to a prominent article and its links | SELECT
CONCAT("[[User:",actor_name,"|",actor_name,"]]") as userlink,
COUNT(*) as edits,
MAX(LEFT(rev_timestamp,8)) as latest_edit_date
FROM revision
JOIN page ON revision.rev_page = page.page_id
JOIN revision_actor_temp
ON revactor_rev=rev_id
JOIN actor
ON revactor_actor=actor_id
WHERE LEFT(rev_ti... | {"resultsets": [{"headers": ["editor", "accepts", "recent_edits"], "rowcount": 299}], "runningtime": "1.10"} | tewiki_p |
Vandalismebestrijding nlwiki | IP-patrolling | # anonymous edits totals
SELECT
CASE rc_patrolled
WHEN 0 THEN 'unpatrolled'
WHEN 1 THEN 'manually patrolled'
WHEN 2 THEN 'autopatrolled'
END AS rc_patrolled,
COUNT(*) AS 'count'
FROM recentchanges, actor
WHERE rc_actor=actor_id AND actor_user IS NULL
GROUP BY rc_patrolled
UNION
SELECT 'total... | {"resultsets": [{"headers": ["actor_id", "actor_user", "actor_name"], "rowcount": 10}], "runningtime": "0.07"} | nlwiki_p |
Last 10,000 edited article page IDs | null | SELECT rc_cur_id
FROM recentchanges
-- NS_MAIN=0
WHERE rc_namespace = 0
-- RC_EDIT=0
AND rc_type = 0
ORDER BY rc_timestamp DESC
LIMIT 10000; | {"resultsets": [{"headers": ["user_name", "user_registration"], "rowcount": 64}], "runningtime": "9.41"} | enwiki_p |
Capture QuickStatement external links of {{Artwork}} templates | null | use commonswiki_p;
SELECT REPLACE(REPLACE(REPLACE(el_to, 'https://quickstatements.toolforge.org/#/v1=',''), '%7C','|'),'||','#')
FROM externallinks
JOIN page ON page_id = el_from
JOIN categorylinks ON cl_from = page_id
WHERE
page_namespace in (6,14) and #14
cl_to='Artworks_with_Wikidata_item:_quick_statements' AN... | {"resultsets": [{"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["tl_title"], "rowcount": 0}, {"headers": ["page_title", "rev_timestamp"], "rowcount": 1}, {"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title", "pp_propname"], "r... | commonswiki_p |
Suspicious user talk page moves | null | select log_id,log_timestamp,(select actor_name from actor where log_actor=actor_id) as "user",
log_title,log_params,(select comment_text from comment where comment_id=log_comment_id) as "summary"
from logging where log_type="move" and log_namespace=2 and log_params like "%4::target%" and log_title not like "%/%"
order ... | {"resultsets": [{"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 234}, {"headers": ["distanz_ungefaehr", "gt_lat", "gt_lon", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 45}], "runningtime": "2.54"} | svwiki |
Articles by lint errors just for Obsolete HTML tags excluding center | Based on query: https://quarry.wmflabs.org/query/31876 | select page_title, linter_params, count(*) as page_count
from linter
join page on page.page_id = linter.linter_page
where page.page_namespace=0 and linter_cat=2 and linter_params not like '%"center"%'
group by page.page_id, linter_params
order by count(*) desc, page_title asc
limit 1000; | {"resultsets": [{"headers": ["page_title", "comment_text"], "rowcount": 50712}], "runningtime": "77.73"} | enwiki |
a few ten-year-old articles | null | SELECT page_title, rev_id, rev_timestamp
FROM revision
JOIN page ON rev_page = page_id
WHERE rev_timestamp LIKE '20120310%'
AND rev_parent_id = 0
AND page_namespace = 0
LIMIT 5; | {"resultsets": [{"headers": ["page_title", "rev_timestamp"], "rowcount": 10}], "runningtime": "29.37"} | enwiki_p |
How long does it take? | null | SELECT rev_timestamp FROM revision
WHERE rev_actor=199416600
AND rev_timestamp>20220000000000 | {"connection_id": 20876610} | enwiki_p |
orphaned talks | null | SELECT
page_namespace,
page_id,
page_title,
page_is_redirect,
page_len
... | {"resultsets": [{"headers": ["anv", "grupo", "redigeringar"], "rowcount": 100}], "runningtime": "109.03"} | enwiki_p |
AfC review counts, last 7 days | ** NOT including deleted articles ** | select count(rc_id) as reviews, actor_name,
SUM(comment_text like "%Publishing accepted%") as "accept",
SUM(comment_text like "Declining submission:%") as "decline",
SUM(comment_text like "Rejecting submission:%") as "reject",
concat(round(SUM(comment_text like "%Publishing accepted%") * 100 / c... | {"resultsets": [{"headers": ["Number of blocks", "Month (YYYY MM)"], "rowcount": 215}], "runningtime": "3.35"} | enwiki_p |
Potential wrong-namespace redirects | Seemingly clear as of 2022-03-11 | SELECT page_title, rd_namespace, rd_title
FROM page
JOIN redirect on page_id = rd_from
WHERE page_namespace = 0
AND page_title RLIKE "^((User|Wikipedia|File|MediaWiki|Template|Help|Category|Portal|Draft|TimedText|Module|Gadget(_definition)?|Book|Topic|Education_Program)_?(talk)?|Talk)[^_(\\w]" | {"resultsets": [], "runningtime": "0.03"} | enwiki_p |
recent questionable XNRs from move on enwiki | don't waste queries :P | SELECT log_timestamp, log_title, log_params
FROM logging
WHERE log_type = "move"
AND log_action = "move"
AND log_namespace = 0
AND log_params RLIKE 'target";s:\\d+:"((Wikipedia(?!.*Articles for creation)|File|Template|Help|Category|Portal|TimedText|Module|Gadget( definition)?|Book|Topic|Education Program)( talk)?|(Draf... | {"resultsets": [{"headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page", "actor_id", "actor_user", "actor_name"], "rowcount": 1}], "runningtime": "0.06"} | enwiki_p |
Oli page IDs - Panama Papers names | null | #top 20 at enwiki "List of Russian billionaires"
#plus 2022 US sanctioned Igor Sechin, Kirill Shamalov, Petr Fradkov (Gennady Timchenko is #6 in tp 20)
select page_title, page_id
from page
where page_title in (
'Akhmed_Azimov','Akhmed_Neim_Takha_Sherif','Akhmet_Kamaldinov','Akhmet_Palankoev','Albert_Abramov','Albe... | {"resultsets": [{"headers": ["CONCAT('*{{\u03b1\u03c1\u03c7\u03b5\u03af\u03bf|', REPLACE(REPLACE(p.page_title, '\"', '**DOUBLEQUOTE**'), '_', ' '), '}}')"], "rowcount": 1}], "runningtime": "0.52"} | enwiki |
find invalid ISO:3166-2 codes (commons) | queries table geo-tags for non matching pairs of iso:3166-1 and iso:3166-2 codes, namespace 0, 6, 14 only. | # ISO status 2020-03-02
# last change MK, ZA, ...
use commonswiki_p;
select gt_lat, gt_lon, gt_page_id, gt_name,
(select page_namespace from page where page_id = gt_page_id) as ns,
(select page_title from page where page_id = gt_page_id) as title,
gt_country,gt_region from geo_tags where gt_country not in
( 'XA', 'XI',... | {"resultsets": [{"headers": ["MONTH(log_timestamp)", "COUNT(*)"], "rowcount": 12}], "runningtime": "8.00"} | commonswiki_p |
Oli page IDs - Panama Papers names patronymics cu | null | #top 20 at enwiki "List of Russian billionaires"
#plus 2022 US sanctioned Igor Sechin, Kirill Shamalov, Petr Fradkov (Gennady Timchenko is #6 in tp 20)
select page_title, page_id
from page
where page_title in (
'Akhmed_Azimov','Akhmed_Sherif','Akhmet_Kamaldinov','Akhmet_Palankoev','Albert_Abramov','Albert_Arakelya... | {"resultsets": [{"headers": ["REGEXP_SUBSTR(page_title, \"\\(.*?\\)\")"], "rowcount": 100}], "runningtime": "0.19"} | enwiki |
Oli editor blocks 6 - Panama Papers names patronymics cu | null | # Simplified query to focus on blocked editors.
# The page_id list can be manually compiled by looking at page id under "page information" in the Wiki web interface,
# or by running Quarry query #62940 with a list of titles.
select page_title as 'page title', actor_name as editor, count(actor_id) as N, comment_... | {"resultsets": [{"headers": ["page_title", "REGEXP_SUBSTR(page_title, \"\\(.*?\\)\")"], "rowcount": 100}], "runningtime": "0.18"} | enwiki |
Count English Wikipedia autoconfirmed users | null | SELECT COUNT(*)
FROM `user`
WHERE user.user_editcount >= 10 AND user.user_registration <= (DATE_FORMAT((NOW() - INTERVAL 4 DAY), '%Y%m%d%H%i%S'))
; | {"resultsets": [{"headers": ["log_id", "log_type", "log_action", "log_timestamp", "log_actor", "log_namespace", "log_title", "log_comment_id", "log_params", "log_deleted", "log_page"], "rowcount": 0}], "runningtime": "0.05"} | plwiki_p |
Most protected pages | 5000 pages in Vietnamese Wikipedia that had been protected the most. | SELECT
log_namespace AS namespace,
log_title AS protected_page,
COUNT(log_title) AS occurrences,
MAX(log_timestamp) AS latest_occurence
FROM logging
WHERE log_type = "protect"
GROUP BY namespace, protected_page
ORDER BY occurrences DESC
LIMIT 5000; | {"resultsets": [{"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"], "rowcount": 100}], "runningtime": "0.24"} | enwiki_p |
All page titles in article name space with zwnj per user | All page titles which contain ZWNJ ( 0xE2808C) followed by space (in between) or ZWNJ at the end per logged in user with count of 5 or more
| SELECT
CONCAT('[[User:',actor_name,'|',actor_name,']]') as creator,
COUNT(*) AS titles_zwnj_count
from page p
join revision ON rev_page = p.page_id AND rev_parent_id = 0 AND p.page_namespace=0
join actor ON actor_id=rev_actor
# where page_title ='బిశ్వ_భూషణ్_హరిచందన్'
where (HEX(page_title) LIKE '%... | {"resultsets": [{"headers": ["tl_title"], "rowcount": 74}], "runningtime": "1465.77"} | tewiki_p |
Flyttar från användarnamnrymden till huvudnamnrymden | Listar flyttar från användarnamnrymden till huvudnamnrymden sedan 1 februari 2022 med ursprung, mål, användare som flyttat, tidpunkt och storlek på sidan i byte. | SELECT CONCAT('Användare:', log_title) AS Från, page_title AS Till, actor_name AS Vem, log_timestamp AS När, page_len AS Storlek
FROM logging
LEFT JOIN page ON log_page=page_id
LEFT JOIN actor on log_actor=actor_id
WHERE log_type = 'move'
AND log_namespace = 2
AND page_namespace = 0
AND log_timestamp between '202202010... | {"resultsets": [{"headers": ["CONCAT('*{{lf|', REPLACE(REPLACE(p.page_title, '\"', '**DOUBLEQUOTE**'), '_', ' '), '}}')"], "rowcount": 321}], "runningtime": "17.64"} | svwiki |
clumsiest editor | null | SELECT actor_name, COUNT(*)
FROM revision_userindex
JOIN comment_revision ON rev_comment_id = comment_id
JOIN actor_revision ON rev_actor = actor_id
WHERE
comment_text LIKE "%oops%"
GROUP BY 1
ORDER BY 2 DESC | {"resultsets": [{"headers": ["page_title"], "rowcount": 430}], "runningtime": "0.83"} | enwiki_p |
Twinkle edit tewiki | For new twinkle yet to deployed as of 2022-03-12 | 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 = 'twinkle')
GROUP BY user
ORDER BY cnt DESC
LIMIT 1000; | {"connection_id": 32100422} | tewiki_p |
Actively collaborated article pages yearwise | Actively collaborated pages yearwise (>9 loggedin non bot, awb editors) in recent years
| SELECT
LEFT(rev_timestamp,4) as year,
CONCAT("[[",page_title,"]]") as pagename,
COUNT(DISTINCT user_name) as num_editors
FROM page
LEFT JOIN revision ON revision.rev_page = page.page_id
JOIN revision_actor_temp
ON revactor_rev=rev_id
JOIN actor
ON revactor_actor=actor_id
JOIN user
ON user_id ... | {"resultsets": [], "runningtime": "0.03"} | tewiki_p |
Actively collaborated article pages - contributors | Actively collaborated pages contributors for a specifc year with year contributions (>9 loggedin non bot, awb editors) in recent years
| SELECT
user_name
FROM user
JOIN actor ON user_id =actor_user
JOIN revision_actor_temp ON revactor_actor=actor_id
JOIN revision ON revactor_rev=rev_id
JOIN page on revision.rev_page = page.page_id
Where (LEFT(rev_timestamp,4)="2021" AND actor_user !=0 AND LEFT(rev_timestamp,4)="2021" AND page_namespace =0 AND... | {"resultsets": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %"], "rowcount": 15}], "runningtime": "11.15"} | tewiki_p |
Vandalismebestrijding nlwiki | Vandalismebestrijding nlwiki, 616 unpatrolled, 12 March 2022, 14:12 (CET) | # anonymous edits totals
SELECT
CASE rc_patrolled
WHEN 0 THEN 'unpatrolled'
WHEN 1 THEN 'manually patrolled'
WHEN 2 THEN 'autopatrolled'
END AS rc_patrolled,
COUNT(*) AS 'count'
FROM recentchanges, actor
WHERE rc_actor=actor_id AND actor_user IS NULL
GROUP BY rc_patrolled
UNION
SELECT 'total... | {"resultsets": [{"headers": ["Usuario", "COUNT(*)", "CONCAT('Total agradecer 2021 a fecha ', 'Fecha')"], "rowcount": 100}], "runningtime": "0.46"} | nlwiki_p |
The count revisions per one day. | null | select date(rev_timestamp) as date, count(*) from revision group by date order by date | {"resultsets": [{"headers": ["page_title", "actor_name"], "rowcount": 1}], "runningtime": "47.77"} | ukwiki |
Page links last updated before February 2010 (and not NULL) | Please don't re-submit this query. I'd like to preserve it for posterity as the first query I made to begin the project to keep the page links timely-updated.
This was forked to https://quarry.wmcloud.org/query/63055 | SELECT
page_links_updated,
page_namespace,
page_title
FROM page
WHERE SUBSTR(page_links_updated, 1,6) < 201002
GROUP BY page_links_updated
ORDER BY page_links_updated;
| {"resultsets": [{"headers": ["user", "review_cnt"], "rowcount": 64}], "runningtime": "0.19"} | enwiki |
NoLicense query | null | SELECT
p0.page_namespace,
p0.page_title,
CONCAT("User talk:", actor_name)
FROM
categorylinks
JOIN page p0 ON cl_from = p0.page_id
JOIN logging_logindex
ON log_page = p0.page_id AND log_type = "upload"
JOIN actor_logging ON log_actor = actor_id
WHERE
cl_to = "Files_with_no_machine-readable_license"
... | {"resultsets": [{"headers": ["date", "reviews", "accepts", "declines", "rejects", "accept %", "decline %", "reject %"], "rowcount": 31}], "runningtime": "18.11"} | commonswiki_p |
Hewiki category tree | null | USE nlwiki_p;
SELECT p1.page_id as 'From', p1.page_title as 'From title' , p2.page_id as 'To', cl_to as 'To title'
FROM page as p1 JOIN categorylinks JOIN page as p2
ON p1.page_namespace = 14 AND p1.page_id=cl_from AND cl_to = p2.page_title AND p2.page_namespace = 14 | {"resultsets": [{"headers": ["tl_from", "tl_namespace", "tl_title", "tl_from_namespace", "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": 0}],... | nlwiki_p |
Most active IP users - debug | null | SELECT *
# SELECT page_title, rc_timestamp #, categorylinks.*
#SELECT COUNT(DISTINCT comment_id) as counter, page_title
FROM recentchanges
JOIN page ON page_id = rc_cur_id
JOIN actor ON rc_actor = actor_id
JOIN comment_recentchanges ON rc_comment_id = comment_id
# INNER JOIN ip_changes ON rc_cur_id=ipc_rev_id
JOIN cat... | {"resultsets": [{"headers": ["pagename"], "rowcount": 199}], "runningtime": "0.68"} | nlwiki |
Recent changes -- except in sport categories | null | # SELECT *
SELECT page_title, rc_timestamp #, categorylinks.*
#SELECT COUNT(DISTINCT comment_id) as counter, page_title
FROM recentchanges
JOIN page ON page_id = rc_cur_id
JOIN actor ON rc_actor = actor_id
JOIN comment_recentchanges ON rc_comment_id = comment_id
# INNER JOIN ip_changes ON rc_cur_id=ipc_rev_id
# JOIN c... | {"resultsets": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %"], "rowcount": 102}], "runningtime": "11.84"} | nlwiki_p |
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": [{"headers": ["COUNT(1)"], "rowcount": 1}], "runningtime": "91.22"} | eswiki |
All articles with zwnj followed by space with redirect target | All page titles which contain undesired ZWNJ ( 0xE2808C) followed by space or at the end of string excl. redirects with redirect name removing the pattern,
zwnj at end is not converted, needs further edits outside.
| SELECT
CONCAT("[[",REPLACE(page_title, '_', ' '),"]]") as page_name,
CONCAT("[[",REPLACE(UNHEX(REPLACE(HEX(page_title),'E2808C5F', '5F')),'_',' ') ,"]]") as target_name
from page p
join revision ON rev_page = p.page_id AND rev_parent_id = 0 AND p.page_namespace=0 AND page_is_redirect =0
join actor ON ... | {"resultsets": [{"headers": ["page_title", "page_id", "page_is_redirect"], "rowcount": 0}], "runningtime": "2.88"} | tewiki_p |
List of category | To print the page list of the one category.
Warning: The return link do can inlude the name of another category. | SELECT page_title, cl_to
FROM categorylinks
LEFT JOIN page ON (cl_from = page_id)
WHERE cl_to = "Linux" | {"resultsets": [{"headers": ["page_title"], "rowcount": 404}], "runningtime": "0.80"} | skwiki |
Get info for a single category | null | SELECT * FROM category WHERE cat_title = 'Sportfilm';
SELECT *, page_title FROM categorylinks
JOIN page ON page_id = cl_from
WHERE cl_to = 'Sportfilm' and cl_type = 'subcat'
LIMIT 30;
| {"resultsets": [{"headers": ["link_title", "page_title"], "rowcount": 71006}], "runningtime": "85.20"} | nlwiki_p |
All articles which are redirects to zwnj-fix | All page titles which contain undesired ZWNJ ( 0xE2808C) followed by space or at the end of string excl.
| SELECT
rdc.page_title,
p3.page_title
FROM page p3
JOIN (
SELECT
p2.page_title,
CASE WHEN HEX(rdp.rd_title_f) LIKE "%E2808C" THEN REPLACE(UNHEX(REVERSE(SUBSTRING(REVERSE(HEX(rdp.rd_title_f)),7))),"_"," ")
ELSE REPLACE(rdp.rd_title_f,"_"," ")
END as rd_title_fn
# END 'rd_ti... | {"resultsets": [{"headers": ["Usuario", "Total", "Total agradecer 2021 a fecha AAAA-MM-DDTHH:MM:SS"], "rowcount": 150}], "runningtime": "0.49"} | tewiki_p |
All articles which are redirects to zwnj-fix -exp | All page titles which contain undesired ZWNJ ( 0xE2808C) followed by space or at the end of string excl.
| SELECT
rdc.page_title,
p3.page_title
FROM page p3
JOIN (
SELECT
p2.page_title,
CASE WHEN HEX(rdp.rd_title_f) LIKE "%E2808C" THEN UNHEX(REVERSE(SUBSTRING(REVERSE(HEX(rdp.rd_title_f)),7)))
ELSE rdp.rd_title_f
END as rd_title_fn
FROM page p2
JOIN (SELECT
page_id,
... | {"resultsets": [{"headers": ["Usuario", "Total", "Total agradecer 2021 a fecha AAAA-MM-DDTHH:MM:SS"], "rowcount": 150}], "runningtime": "0.51"} | tewiki_p |
All articles which are redirects to zwnj-fix -exp2 | All page titles which contain undesired ZWNJ ( 0xE2808C) followed by space or at the end of string excl.
| SELECT
rdc.page_title,
p3.page_title
FROM page p3
JOIN (
SELECT
p2.page_title,
CASE WHEN HEX(rdp.rd_title_f) LIKE "%E2808C" THEN UNHEX(REVERSE(SUBSTRING(REVERSE(HEX(rdp.rd_title_f)),7)))
ELSE rdp.rd_title_f
END as rd_title_fn
FROM page p2
JOIN (SELECT
page_id,
... | {"resultsets": [{"headers": ["Usuario", "Total", "Total agradecer 2021 a fecha AAAA-MM-DDTHH:MM:SS"], "rowcount": 100}], "runningtime": "0.48"} | tewiki_p |
Number of Dagbani Lexemes per user | null | select actor_name, count(*) c
from revision_userindex
join page on rev_page=page_id
join actor_revision on rev_actor=actor_id
JOIN pagelinks ON page.page_id=pagelinks.pl_from
where page_namespace = 146
AND pagelinks.pl_title="Q32238" # Dagbani
group by actor_user
order by c desc;
| {"resultsets": [{"headers": ["Usuario", "Total", "Total agradecer 2021 a fecha AAAA-MM-DDTHH:MM:SS"], "rowcount": 100}], "runningtime": "0.46"} | wikidatawiki_p |
Empty article talks on plwiki | null | USE plwiki_p;
SELECT concat("# [[Dyskusja:",page_title,"]]") AS page_title
FROM plwiki_p.page
WHERE page_namespace = 1 AND page_len = 0
ORDER BY page_title; | {"resultsets": [{"headers": ["pl_from", "pl_title", "cl_to"], "rowcount": 300}], "runningtime": "3.88"} | plwiki_p |
All articles with zwnj followed by space per user (excl.redirects) | All page titles which contain ZWNJ ( 0xE2808C) followed by space per logged in user with count of 5 or more (excl. redirects)
| SELECT
CONCAT('[[User:',actor_name,'|',actor_name,']]') as creator,
COUNT(*) AS titles_zwnj_count
from page p
join revision ON rev_page = p.page_id AND rev_parent_id = 0 AND p.page_namespace=0 AND page_is_redirect =0
join actor ON actor_id=rev_actor
# where page_title ='బిశ్వ_భూషణ్_హరిచందన్'
where ... | {"resultsets": [{"headers": ["concat(\"\u09aa\u09be\u09a4\u09be:\", page_title)", "page_len"], "rowcount": 1187}], "runningtime": "2.14"} | tewiki_p |
All articles which redirect to page with unnecessary zwnj | All articles which redirect to page with unnecessary zwnj
| SELECT
DISTINCT REPLACE(p2.page_title,"_"," ") as page_name,
CASE WHEN HEX(rdp.rd_title_f) LIKE "%E2808C" THEN REPLACE(UNHEX(REVERSE(SUBSTRING(REVERSE(HEX(rdp.rd_title_f)),7))),"_"," ")
ELSE REPLACE(rdp.rd_title_f,"_"," ")
END as rd_title_fn
# END 'rd_title_fn'
# ELSE UNHEX(LEFT(H... | {"resultsets": [{"headers": ["concat(\"\u09aa\u09be\u09a4\u09be:\", page_title)", "page_len"], "rowcount": 10634}], "runningtime": "13.13"} | tewiki_p |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.