title stringlengths 1 212 | description stringlengths 1 4.39k ⌀ | query stringlengths 1 65.5k ⌀ | extra_info stringlengths 18 31.6k | wikidb stringlengths 4 26 ⌀ |
|---|---|---|---|---|
Vandalismebestrijding nlwiki (IP-patrolling) | null | # anonymous edits totals
SELECT
CASE rc_patrolled
WHEN 0 THEN 'unpatrolled'
WHEN 1 THEN 'manually patrolled'
WHEN 2 THEN 'autopatrolled'
END AS rc_patrolled,
COUNT(*) AS 'count'
FROM recentchanges, actor
WHERE rc_actor=actor_id AND actor_user IS NULL
GROUP BY rc_patrolled
UNION
SELECT 'total... | {"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_... | nlwiki_p |
Not blocked users that have made a revision in a given timespan | The motivation for creating this query is that I wanted to know which users had contributed to Quechua Wikipedia in the last 6 months so that I could then invite them to the Telegram group used by the volunteers of that Wikipedia language edition. | # DONE: Count backward a given timespan
# DONE: Filter out IPv4 and IPv6 addresses
# DONE: Show year, month and day of the latest revision per user
# DONE: Show number of revisions per user
# TODO: Filter out banned users
WITH
banned_actors AS (
SELECT DISTINCT actor_id
FROM ipblocks
JOIN user ON ipb_user = u... | {"resultsets": [{"headers": ["tl_title"], "rowcount": 119}], "runningtime": "1862.63"} | quwiki_p |
# of autopatrolled articles created per day | null | SELECT *, SUBSTRING(ptrl_timestamp, 1, 8) AS day
FROM pagetriage_log
WHERE ptrl_reviewed = 3
ORDER BY ptrl_timestamp DESC | {"resultsets": [{"headers": ["count(*)"], "rowcount": 1}], "runningtime": "2.15"} | enwiki |
# of autopatrolled articles created per month | Notes: "group by" needs to go above "order by". use count(*) not count(day) | SELECT SUBSTRING(ptrl_timestamp, 1, 6) AS month, COUNT(*)
FROM pagetriage_log
JOIN page ON ptrl_page_id = page_id
WHERE ptrl_reviewed = 3
AND page_namespace = 0
GROUP BY month
ORDER BY ptrl_timestamp DESC | {"resultsets": [{"headers": ["cl_to", "page_title"], "rowcount": 7}], "runningtime": "0.57"} | enwiki |
Duplicate Wikipedia files (lvwiki) | null | SELECT concat("* [[:FILE:",p.page_title,"]]") FROM page p
WHERE p.page_namespace = 6
LIMIT 10
| {"resultsets": [{"headers": ["rd_from", "rd_title", "total"], "rowcount": 100}], "runningtime": "1.73"} | tewiki_p |
Wiki Science Competition 2021 in Ukraine Participants | null | SELECT A.actor_name, COUNT(1) as files
FROM commonswiki_p.image I
JOIN commonswiki_p.page P ON I.img_name = P.page_title
JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from
JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id
WHERE P.page_namespace = 6
AND CL.cl_to = "Images_from_Wiki_Science_Competitio... | {"resultsets": [{"headers": ["rd_from", "page_title", "rd_title", "total"], "rowcount": 100}], "runningtime": "38.02"} | commonswiki_p |
Try to find Commons images with a resolution of 37.8 dpc | in order to find all images related to https://commons.wikimedia.org/wiki/Commons:Deletion_requests/Files_in_Category:Photos_from_Parlamentul_Republicii_Moldova_Flickr_stream | select img_name, img_metadata from image
where img_metadata like '%"BIZGU EDUARD"%' limit 1000; | {"resultsets": [{"headers": ["user", "img_count"], "rowcount": 109}], "runningtime": "5.83"} | commonswiki |
Articles in both a mother and a daughter category | null | SELECT
p1.page_title,
cl1.cl_to,
cl2.cl_to
FROM page p1 -- article
JOIN categorylinks cl1 -- daughter
ON p1.page_id = cl1.cl_from
JOIN categorylinks cl2 -- mother
ON p1.page_id = cl2.cl_from
JOIN page p2 -- daughter cat page
ON cl1.cl_to = p2.page_title
AND p2.page_namespace = 14
JOIN categorylinks cl3
... | {"resultsets": [{"headers": ["page_title"], "rowcount": 10}], "runningtime": "53.73"} | fawiki_p |
Duplicate Wikipedia files | These should normally be tagged with {{db-f1}}. | SELECT DISTINCT p.page_id
FROM image a
INNER JOIN image b ON a.img_sha1 = b.img_sha1 AND a.img_name != b.img_name
INNER JOIN page p ON p.page_title = a.img_name AND p.page_namespace = 6
WHERE a.img_sha1 NOT IN ("r8v6t7yq6jkgo3s12gkj30ibin2fkys", # phabricator:T244567 (JPG)
"4mf2zdddsd2n8y75y9ls... | {"resultsets": [{"headers": ["count(page_title)", "actor_name"], "rowcount": 744}], "runningtime": "74.63"} | enwiki_p |
unreviewed articles per WikiProject | null | SELECT DISTINCT article.page_title AS PT, CONCAT("https://en.wikipedia.org/wiki/", article.page_title) AS link
FROM page article
JOIN page talkpage ON article.page_title = talkpage.page_title
JOIN templatelinks ON talkpage.page_id=templatelinks.tl_from
WHERE article.page_id IN (
SELECT page.page_id
FROM revision
JOI... | {"resultsets": [{"headers": ["page_title", "actor_name"], "rowcount": 744}], "runningtime": "68.50"} | enwiki |
hewiki most prolific translators | null | use thwiki_p;
SELECT
rev_actor,
actor_name,
count(revision.rev_id) as articles_created
FROM
change_tag,
actor,
revision
WHERE
revision.rev_parent_id = 0 AND
ct_tag_id = (select ctd_id from change_tag_def where ctd_name = 'contenttranslation') AND
rev_id = ct_rev_id AND
rev_actor = actor_id
GROUP BY
rev_acto... | {"resultsets": [{"headers": ["CONCAT('{{Commons:', p.page_title, '}}')"], "rowcount": 140}], "runningtime": "5.97"} | thwiki_p |
CU blocks per month | null | SELECT COUNT(ipb_id) as "Number of CU blocks", ipb_timestamp DIV 100000000 as "Month (YYYY MM)"
FROM ipblocks
JOIN comment ON (ipblocks.ipb_reason_id = comment.comment_id)
WHERE comment.comment_text LIKE "{{checkuserblock-account}}%"
GROUP BY ipb_timestamp DIV 100000000
ORDER BY ipb_timestamp DESC
LIMIT 40 | {"resultsets": [{"headers": ["TITLE", "page_namespace"], "rowcount": 100}], "runningtime": "0.26"} | enwiki_p |
Singles lowercase after dash | null | select page_title from page where page_namespace=0
and page_is_redirect=0
and (page_title like '%_–_%_singles')
| {"resultsets": [{"headers": ["pl_from", "pl_title"], "rowcount": 190}], "runningtime": "3.66"} | enwiki_p |
File count | For images without license information, output created user and date, used the logic of https://quarry.wmcloud.org/query/53676 | select
page_title
from page
where page_namespace =6
| {"resultsets": [{"headers": ["pl_from", "pl_title"], "rowcount": 190}], "runningtime": "3.52"} | tewiki_p |
tewiki most prolific translators | null |
SELECT
rev_actor,
actor_name,
count(revision.rev_id) as articles_created
FROM
change_tag,
actor,
revision
WHERE
revision.rev_parent_id = 0 AND
ct_tag_id = (select ctd_id from change_tag_def where ctd_name = 'contenttranslation') AND
rev_id = ct_rev_id AND
rev_actor = actor_id
GROUP BY
rev_actor
ORDER BY
a... | {"resultsets": [{"headers": ["File name", "Date", "Size", "Uploader's name"], "rowcount": 40}], "runningtime": "579.75"} | tewiki_p |
sport double capping | null | select page_title from page where page_namespace=0
and page_is_redirect=0
and ((page_title like '%_–_Men''s_Singles')
or (page_title like '%_–_Women''s_Singles')
or (page_title like '%_–_Mixed''s_Singles')
or (page_title like '%_–_Men''s_Doubles')
or (page_title like '%_–_Women''s_Doubles')
or (page_title lik... | {"resultsets": [{"headers": ["pages"], "rowcount": 1}], "runningtime": "98.39"} | enwiki_p |
dash Best | null | select page_title from page where page_namespace=0
and page_is_redirect=0
and (page_title like '%Best$_Act%$_–$_%' ESCAPE '$')
| {"connection_id": 276972682} | enwiki_p |
Count fixes in Wikipedia:Correct typos in one click | null | SELECT comment_text
FROM revision
LEFT JOIN comment on rev_comment_id=comment_id
WHERE rev_page in (60533818,62053073,61925999,61926002,61926007,61926012,61926014,62002342,62002343,62002345,62002348,62002349,61925967,62057349,61925968,61925974,61925980,61925985,61925989,61925991,61925997)
AND comment_text LIKE "% fixed... | {"connection_id": 276984563} | enwiki_p |
ruwiki: List categories having " in their names | null | use ruwiki_p;
select * from category
where
cat_title like '%"%' | {"resultsets": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %"], "rowcount": 94}], "runningtime": "7.03"} | ruwiki_p |
Bengali Wikipedia Section Translation edits | null | use thwiki_p;
-- When appropriate, change 'contenttranslation' to 'sectiontranslation'
set @cx_edit_tag = (
select
ctd_id
from
change_tag_def
where
ctd_name = 'sectiontranslation'
);
select
date_format(rev_timestamp, "%Y-%m-%d %H:%i:%s") as 'Time',
rev_id as 'Revision ID',
actor_name as 'Us... | {"resultsets": [{"headers": ["count(DISTINCT page_id)"], "rowcount": 1}], "runningtime": "0.09"} | thwiki_p |
Hashtag edits | null | SELECT * FROM revision
INNER JOIN comment ON revision.rev_comment_id = comment.comment_id
WHERE LOWER(comment.comment_text) LIKE "%#shesaid%"
AND revision.rev_timestamp > "20210901000000" | {"resultsets": [{"headers": ["cl_to", "count_cl_to"], "rowcount": 26}, {"headers": ["page_title"], "rowcount": 20}, {"headers": ["tl_title", "count_tl_title"], "rowcount": 3}, {"headers": ["page_title", "pl_title"], "rowcount": 1}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, ... | enwiki_p |
Pages in ptwiki that should be in a category list but are not | Query reletad to the task https://phabricator.wikimedia.org/T297569 | SELECT CONCAT('Categoria:', page_title) PAGES
FROM templatelinks
INNER JOIN page ON tl_from = page_id
WHERE tl_namespace = 10 AND tl_title = 'Cab-ice' AND
page_id NOT IN (SELECT cl_from FROM categorylinks WHERE cl_to = '!Categorias_vazias_que_não_devem_ser_eliminadas') | {"resultsets": [{"headers": ["actor_name", "count(*)"], "rowcount": 1}], "runningtime": "7.78"} | ptwiki_p |
Tewiki: TG Mandals districts | null | set @dist="ఆదిలాబాద్";
select p1.page_title మండలం,c1.cl_to జిల్లా from categorylinks c1,page p1
where p1.page_id=c1.cl_from and
c1.cl_to in (SELECT p3.page_title
FROM categorylinks c3,page p3
WHERE
p3.page_id=c3.cl_from and
c3.cl_to = "తెలంగాణ_మండలాలు")
order by జిల్లా,మండలం
| {"connection_id": 51868260} | tewiki |
Wiki Science Competition 2021 in Ukraine Participants | null | SELECT A.actor_name, COUNT(1) as files
FROM commonswiki_p.image I
JOIN commonswiki_p.page P ON I.img_name = P.page_title
JOIN commonswiki_p.categorylinks CL ON P.page_id = CL.cl_from
JOIN commonswiki_p.actor A ON I.img_actor = A.actor_id
WHERE P.page_namespace = 6
AND CL.cl_to = "Images_from_Wiki_Science_Competitio... | {"resultsets": [{"headers": ["rd_title", "page_title"], "rowcount": 1}], "runningtime": "0.58"} | commonswiki_p |
Pages with size 0 | null | USE viwiki_p;
SELECT
page_namespace AS namespace,
page_title AS title
FROM page
WHERE page_len = 0
AND page_namespace > 3 -- không tính Trang thảo luận, trang thành viên, và trang thảo luận thành viên
ORDER BY namespace, title; | {"resultsets": [{"headers": ["time", "user", "namespace", "page", "comment"], "rowcount": 0}], "runningtime": "0.07"} | viwiki |
Creation user and date for local media files with no license | For images without license information, output created user and date, used the logic of https://quarry.wmcloud.org/query/53676 | set @dbname = 'tewiki';
select
CONCAT("File:", img_name) as pagename
from image
join page ON page_namespace=6 AND page_title=img_name
join revision ON rev_page = page_id AND rev_parent_id = 0
join actor ON actor_id=rev_actor
where
page_is_redirect=0
AND NOT EXISTS(
SELECT * FROM... | {"resultsets": [{"headers": ["page_id"], "rowcount": 18}], "runningtime": "8.22"} | tewiki_p |
Vandalismebestrijding (IP-patrolling) Nlwiki | null | # anonymous edits totals
SELECT
CASE rc_patrolled
WHEN 0 THEN 'unpatrolled'
WHEN 1 THEN 'manually patrolled'
WHEN 2 THEN 'autopatrolled'
END AS rc_patrolled,
COUNT(*) AS 'count'
FROM recentchanges, actor
WHERE rc_actor=actor_id AND actor_user IS NULL
GROUP BY rc_patrolled
UNION
SELECT 'total... | {"resultsets": [{"headers": ["gu_id", "gu_name", "gu_enabled", "gu_enabled_method", "gu_home_db", "gu_email", "gu_email_authenticated", "gu_salt", "gu_password", "gu_locked", "gu_hidden", "gu_registration", "gu_password_reset_key", "gu_password_reset_expiration", "gu_auth_token"], "rowcount": 0}], "runningtime": "0.08"... | nlwiki_p |
Most prolific akwiki editors since 2010 | null | select
rev_actor,
count(rev_id) as edit_count,
actor_name
from
revision,
actor
where
rev_timestamp > 20100000000000 and
rev_actor = actor_id
group by
rev_actor
order by
edit_count desc
limit 200; | {"resultsets": [{"headers": ["page_title", "rd_title"], "rowcount": 1}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["tl_title"], "rowcount": 0}, {"headers": ["page_title", "rev_timestamp"], "rowcount": 2}, {"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title", "pp_propname"], "r... | akwiki |
Blank Comments talk subpages | null | USE enwiki_p;
SELECT CONCAT("Talk:", com.page_title) as title, CONCAT("Talk:", target.page_title) as target
FROM page com
JOIN page target ON target.page_title = REPLACE(com.page_title, "/Comments", "")
WHERE
com.page_namespace = 1
AND target.page_namespace = 1
AND com.page_title LIKE "%/Comments"
AND com... | {"connection_id": 9153128} | enwiki_p |
sitelinks per project | null | SELECT ips_site_id, COUNT(*)
FROM wb_items_per_site
GROUP BY ips_site_id
ORDER BY ips_site_id | {"resultsets": [{"headers": ["page_id"], "rowcount": 6}], "runningtime": "12.17"} | wikidatawiki_p |
Most frequent domains (nowiki) | null | USE nowiki_p;
SELECT
COUNT(*),
TRIM(LEADING 'www.' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(el_to, '/', 3),'/',-1)) AS site
FROM externallinks, page
WHERE el_from = page_id
AND page_namespace = 0
GROUP BY 2
HAVING COUNT(*) >= 100
ORDER BY COUNT(*) DESC ; | {"resultsets": [{"headers": ["reviews", "rc_title", "accepted", "accept %", "declined", "decline %"], "rowcount": 1284}], "runningtime": "14.24"} | nowiki_p |
Total admin actions per month on nowiki | null | USE nowiki_p;
SELECT
DATE(CONCAT(YEAR(log_timestamp), '-', MONTH(log_timestamp), '-01')) AS Month,
COUNT(log_id) AS Actions
FROM logging
WHERE log_type IN ('block', 'delete', 'import', 'merge', 'protect', 'rights')
GROUP BY Month; | {"resultsets": [{"headers": ["editor", "accepts", "recent_edits"], "rowcount": 1692}], "runningtime": "12.71"} | nowiki_p |
last edit by editor (NL version, not slow as a dog) | null | DESCRIBE revision_userindex; | {"resultsets": [{"headers": ["linter_id", "linter_page", "linter_cat", "linter_start", "linter_end", "linter_params"], "rowcount": 1}], "runningtime": "0.10"} | enwiki |
Users with most edits in the 30 days before a date | List of a user's edit times. | WITH groups AS (
SELECT ug_user, GROUP_CONCAT(ug_group) AS memberships
FROM user_groups
GROUP BY ug_user)
SELECT
actor.actor_name AS thành_viên,
memberships AS nhóm,
COUNT(rev_id) AS lần_sửa_đổi
FROM revision LEFT JOIN actor ON (revision.rev_actor = actor.actor_id)
LEFT JOIN groups ON (actor.actor_user ... | {"resultsets": [{"headers": ["page_namespace", "page_title"], "rowcount": 3}], "runningtime": "0.16"} | viwiki_p |
People with most edits before a certain date | List of pages with the most number of editors | SELECT
actor.actor_name AS actor_name,
COUNT(*) AS count
FROM revision LEFT JOIN actor ON (rev_actor = actor_id)
WHERE rev_timestamp < "2021-11-16"
GROUP BY actor_name
ORDER BY count DESC
LIMIT 200; | {"connection_id": 42676083} | viwiki_p |
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim 3/4 roku | lista redaktorów plwikisource z ponad 10 edycjami w ostatnim roku | USE plwikisource_p;
SELECT bl_to, COUNT( DISTINCT bl_from ) as nlinks FROM brokenlinks GROUP BY bl_to HAVING nlinks ORDER BY nlinks DESC LIMIT 100;
| {"resultsets": [{"headers": ["actor_name", "rc_this_oldid", "comment_text"], "rowcount": 45}], "runningtime": "11.99"} | plwikisource_p |
lista redaktorów plwikisource z ponad 10 edycjami w ostatnim 3/4 roku | lista redaktorów plwikisource z ponad 10 edycjami w ostatnim roku | USE plwikisource_p;
SELECT pl_namespace as namespace, pl_title as title, COUNT( * ) as abc
FROM pagelinks
LEFT JOIN page as pg1 ON pg1.page_namespace = pl_namespace AND pg1.page_title = pl_title
LEFT JOIN page as pg2 ON pg2.page_id = pl_from
WHERE pg1.page_namespace IS NULL AND pl_namespace = 104 AND pg2.page_namespa... | {"resultsets": [{"headers": ["img_name", "img_height", "img_width", "size"], "rowcount": 11}], "runningtime": "0.30"} | plwikisource_p |
1000 categories with the longest name in Wikimedia Commons | null | USE commonswiki_p;
SELECT page_title, LENGTH(page_title) AS length
FROM page
WHERE page_namespace = 14
ORDER BY length DESC
LIMIT 1000 | {"resultsets": [{"headers": ["img_name", "img_height", "img_width", "size"], "rowcount": 10}], "runningtime": "0.14"} | commonswiki_p |
Week days (2) | null | SET
STATEMENT max_statement_time = 900 FOR
WITH rc_counts AS (
SELECT
rc_actor,
COUNT(*) AS total,
SUM(
CASE
WHEN day = 1 THEN 0
WHEN day = 7 THEN 0
ELSE 1
END
) AS weekdays,
COUNT(DISTINCT day) AS dist_days,
COUNT(DISTINCT hour) AS dist_hours
FROM
(... | {"resultsets": [{"headers": ["year", "month", "page_namespace", "count"], "rowcount": 290}], "runningtime": "26.32"} | enwiki_p |
Links to nli.org.il in hewiki | null | use commonswiki_p;
select
el_from,
page_title,
el_to
from
externallinks,
page
where
el_to like '%nli.org.il%' and
el_from = page_id
limit 500000; | {"resultsets": [{"headers": ["title"], "rowcount": 1}], "runningtime": "51.06"} | commonswiki_p |
Links to nli.org.il in hewiki | null | use enwiki_p;
select
el_from,
page_title,
el_to
from
externallinks,
page
where
el_to like '%nli.org.il%' and
el_from = page_id
limit 500000; | {"resultsets": [{"headers": ["title"], "rowcount": 27}], "runningtime": "47.29"} | enwiki_p |
Links to nli.org.il in hewiki | null | use commonswiki_p;
select
el_from,
page_title,
el_to
from
externallinks,
page
where
el_to like '%nli.org.il%' and
el_from = page_id
limit 5000000; | {"resultsets": [{"headers": ["page_title", "comment_text"], "rowcount": 10994}], "runningtime": "29.03"} | commonswiki_p |
Links to nli.org.il in hewiki | null | use hewiki_p;
select
el_from,
page_title,
el_to
from
externallinks,
page
where
el_to like '%nli.org.il%' and
el_from = page_id
limit 500000; | {"resultsets": [{"headers": ["namespace", "page", "title", "latest_edit"], "rowcount": 20}], "runningtime": "0.12"} | hewiki_p |
# of articles marked as reviewed by NPP per month | Notes: "group by" needs to go above "order by". use count(*) not count(day) | SELECT SUBSTRING(ptrl_timestamp, 1, 6) AS month, COUNT(*)
FROM pagetriage_log
JOIN page ON ptrl_page_id = page_id
WHERE ptrl_reviewed = 1
AND page_namespace = 0
AND page_is_redirect = 0
GROUP BY month
ORDER BY ptrl_timestamp DESC | {"resultsets": [{"headers": ["actor_name", "comment_text", "page_title"], "rowcount": 735}], "runningtime": "1.31"} | enwiki |
# of articles marked as autopatrolled per month | Notes: "group by" needs to go above "order by". use count(*) not count(day) | SELECT SUBSTRING(ptrl_timestamp, 1, 6) AS month, COUNT(*)
FROM pagetriage_log
JOIN page ON ptrl_page_id = page_id
WHERE ptrl_reviewed = 3
AND page_namespace = 0
AND page_is_redirect = 0
GROUP BY month
ORDER BY ptrl_timestamp DESC | {"resultsets": [{"headers": ["actor_name", "comment_text", "page_title"], "rowcount": 28}], "runningtime": "0.17"} | enwiki |
actor_user of autoreviewers | null | #SELECT DISTINCT `ug_group` FROM `user_groups`;
SELECT actor_user #, actor_name
FROM actor
JOIN user_groups
ON ug_user = actor.actor_user
WHERE ug_group = 'autoreviewer'
| {"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": "1.42"} | enwiki |
autopatrolled users who haven't edited in 5 years | null | SELECT actor_name
FROM actor
JOIN user_groups ON ug_user = actor.actor_user
WHERE ug_group = 'autoreviewer'
AND actor_name NOT IN ( #users who created an article in the last month
SELECT actor_name
FROM revision_userindex
JOIN page ON revision_userindex.rev_page = page.page_id
JOIN actor ON revision_userindex... | {"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": 24}], "runningtime": "1.48"} | enwiki |
Most autopatrols in the last year | Notes: "group by" needs to go above "order by". use count(*) not count(day) | SELECT user_name, COUNT(*)
FROM pagetriage_log
JOIN page ON ptrl_page_id = page_id
JOIN user ON user_id = ptrl_user_id
WHERE ptrl_reviewed = 3
AND page_namespace = 0
AND page_is_redirect = 0
GROUP BY user_name
ORDER BY COUNT(*) DESC | {"resultsets": [{"headers": ["tl_from", "tl_namespace", "tl_title", "tl_from_namespace"], "rowcount": 10}], "runningtime": "0.09"} | enwiki |
Most autopatrols in the last month | Notes: "group by" needs to go above "order by". use count(*) not count(day) | SELECT user_name, COUNT(*)
FROM pagetriage_log
JOIN page ON ptrl_page_id = page_id
JOIN user ON user_id = ptrl_user_id
WHERE ptrl_reviewed = 3
AND page_namespace = 0
AND page_is_redirect = 0
AND ptrl_timestamp > DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 MONTH), "%Y%m%d%H%i%s")
GROUP BY user_name
ORDER BY COUNT(*... | {"resultsets": [{"headers": ["tl_from", "tl_namespace", "tl_title", "tl_from_namespace"], "rowcount": 10}], "runningtime": "0.08"} | enwiki |
meta/shading subpage transclusions | null | SELECT CONCAT("Template:", page_title), COUNT(tl_from)
FROM page
LEFT JOIN templatelinks ON tl_title = page_title AND tl_namespace = page_namespace
WHERE
page_namespace = 10
AND (
page_title LIKE "%/meta/shading"
)
GROUP BY page_id
ORDER BY COUNT(tl_from) DESC | {"resultsets": [{"headers": ["date", "page_title"], "rowcount": 0}], "runningtime": "0.24"} | enwiki_p |
Autopatrolled users who haven't edited in 5 years, ordered by approximate edit count | null | SELECT rev_user_text, MAX(rev_timestamp) AS last_edit
FROM revision_userindex
WHERE rev_user_text IN
(
SELECT user_name
FROM user_groups
JOIN user ON ug_user = user_id
WHERE ug_group = 'autoreviewer'
)
GROUP BY rev_user_text;
#SELECT user_name, user_editcount, MAX(rev_timestamp) AS last_edit, ug_group
#FROM page, ... | {"resultsets": [{"headers": ["img_name", "img_height", "img_width", "size"], "rowcount": 9}], "runningtime": "0.13"} | enwiki |
Links to nli.org.il in hewiki | Links to nli.org.il in hewiki | use hewiki_p;
select
el_from,
page_title,
el_to
from
externallinks,
page
where
el_to like '%nli.org.il%' and
el_from = page_id
limit 500000; | {"resultsets": [{"headers": ["rank", "user_name", "user_editcount"], "rowcount": 100}], "runningtime": "0.31"} | hewiki_p |
autopatrolled with no edits in last 5 years by edit count | null | #SELECT actor_name, COUNT(rev_id) as edits# , DATE_FORMAT(rev_timestamp,'%Y-%m') as month
#FROM revision_userindex JOIN actor
#ON rev_actor = actor_id
#WHERE actor_name in ('Vexations', 'Joe Roe')
#GROUP BY rev_actor
#ORDER BY edits ASC
SELECT actor_name, user_editcount
FROM user
JOIN actor ON actor_name = use... | {"connection_id": 10831235} | enwiki |
Local media files with no license for specific user | For images without license information for specific user | set @dbname = 'tewiki';
select
CONCAT("File:", img_name) as pagename
from image
join page ON page_namespace=6 AND page_title=img_name
join revision ON rev_page = page_id AND rev_parent_id = 0
join actor ON actor_id=rev_actor
where
page_is_redirect=0 and actor_name="కార్తీక రాజు"
... | {"connection_id": 31647033} | tewiki_p |
autopatrolled by edit count | null | SELECT user_name, user_editcount
FROM user
JOIN user_groups ON ug_user = user_id
WHERE ug_group = 'autoreviewer'
AND user_name NOT IN (
SELECT actor_name
FROM actor
JOIN revision_userindex ON revision_userindex.rev_actor = actor.actor_id
JOIN user_groups ON ug_user = actor.actor_user
WHERE ug_group = 'auto... | {"resultsets": [{"headers": ["user_name", "user_id", "user_registration"], "rowcount": 50000}], "runningtime": "110.71"} | enwiki |
autopatrolled by edit count | null | SET @rev = (SELECT MIN(rev_id)
FROM revision
WHERE rev_timestamp > DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -5 YEAR), "%Y%m%d%H%i%s"));
SELECT user_name, user_editcount
FROM user
JOIN user_groups ON ug_user = user_id
WHERE ug_group = 'autoreviewer'
AND user_name NOT IN (
SELECT actor_name
FRO... | {"resultsets": [{"headers": ["user_id"], "rowcount": 13}], "runningtime": "0.11"} | enwiki |
kswiki edits by month | null | select
substring(rev_timestamp, 1, 6) as month,
count(rev_id)
from
revision
group by
month
order by
month 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"], "rowcount": 6}], "runningtime": "0.35"} | lnwiki_p |
Quota di contributi verificati nella Wikipedia in italiano | Patrolled edits on the Italian Wikipedia, it.wiki, it.wikipedia.
Quota giornaliera di modifiche modificate fra le ultime modifiche (30 giorni), sul totale e sulle solo modifiche effettuate da utenti non registrati. Sono escluse modifiche segnate come bot, modifiche fuori dal namespace 0, "finte" ultime modifiche (come ... | USE itwiki_p;
SELECT GIORNO, CONTRIBUTI, PATROLLED, CONCAT(ROUND(PATROLLED * 100 / CONTRIBUTI), ' %') AS PERCENTUALE, CONCAT(ROUND(ANONIMIPATROLLED * 100 / ANONIMI), ' %') AS SoloNonRegistrati
FROM (
SELECT SUBSTR(rc_timestamp, 1, 8) AS GIORNO,
SUM(rc_user > -1) AS CONTRIBUTI,
SUM(rc_patrolled) AS PATROLLED,
S... | {"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"], "rowcount": 0}], "runningtime": "4.05"} | itwiki |
Non free files with template links | Non free files uploaded with fair use related template links for subsequent filtering to get with no rationale. | select DISTINCT
tl_title,
actor_name,
LEFT(rev_timestamp,8) as date,
page_title
from image as ss
join page ON page_namespace=6 AND page_title=img_name
join revision ON rev_page = page_id AND rev_parent_id = 0
join actor ON actor_id=rev_actor
join categorylinks ON cl_from=page_id A... | {"resultsets": [{"headers": ["user_id", "user_registration", "year_mo", "survival_1yr"], "rowcount": 1}], "runningtime": "0.08"} | tewiki_p |
Non free files with template links | Non free files uploaded with fair use related template links for subsequent filtering to get with no rationale. | select DISTINCT
tl_title,
actor_name,
LEFT(rev_timestamp,8) as date,
page_title
from image as ss
join page ON page_namespace=6 AND page_title=img_name
join revision ON rev_page = page_id AND rev_parent_id = 0
join actor ON actor_id=rev_actor
join categorylinks ON cl_from=page_id A... | {"resultsets": [{"headers": ["page_title"], "rowcount": 765}], "runningtime": "4.58"} | tewiki_p |
enwikisource template and module counts | Transclusion count for templates and modules on kswiki | SELECT
tl_namespace,
tl_title,
COUNT(*)
FROM templatelinks
WHERE tl_namespace = 10 OR tl_namespace = 828
GROUP BY tl_title
HAVING COUNT(*) > 2000
ORDER BY tl_namespace ASC, COUNT(*) DESC, tl_title ASC
LIMIT 10000; | {"connection_id": 11420192} | enwikisource_p |
Thanks for 2021 frwiki | Most thanked people in 2021
Blame Mz7, SQL, and stwalkerster for this | USE frwiki_p;
SELECT log_title, COUNT(log_id)
FROM logging_logindex
WHERE
log_type = "thanks" AND
log_timestamp >= "20210000000000" AND
log_timestamp <= "20220000000000"
GROUP BY log_title
ORDER BY 2 DESC | {"resultsets": [{"headers": ["count(*)"], "rowcount": 1}], "runningtime": "0.09"} | frwiki |
Références brisées par erreur phabricator | phab:T296044 | select distinct p.page_title from change_tag ctr
inner join revision r on r.rev_id=ctr.ct_rev_id
inner join page p on r.rev_page=p.page_id
where ctr.ct_tag_id=5 and
p.page_namespace=0 and
r.rev_timestamp > '20211118210000'
and r.rev_timestamp < '20211119020000' | {"resultsets": [{"headers": ["ipb_range_start", "ipb_address"], "rowcount": 2}], "runningtime": "2.95"} | frwiki |
Sample search of deleted edits by IP pattern | Publicly-available data on deleted edits made by IPs starting with "75.17.116.".
For [[WP:Help desk#Deleted contributions]] circa 23 Dec 2021. | SELECT *
FROM actor_archive
JOIN archive_userindex
ON ar_actor = actor_id
WHERE actor_user IS NULL
AND actor_name LIKE '75.17.116.%'; | {"resultsets": [{"headers": ["pages_with_disambig_but_not_redir"], "rowcount": 1}, {"headers": ["user_id", "user_name", "user_articles", "user_latestcreation"], "rowcount": 998}], "runningtime": "146.48"} | enwiki_p |
all pages in portal namespace | null | SELECT
page_title
FROM page
WHERE page_namespace = 100
AND page_is_redirect = 0 | {"resultsets": [{"headers": ["el_to"], "rowcount": 100}], "runningtime": "0.24"} | ruwiki_p |
Indef sysop protected articles | Generates a fully-functional wikitable that lists sysop-level indefinitely protected articles. | SELECT
CONCAT ("[[",page_title,"]]") # wikitable formatting
AS 'Article' FROM page
JOIN page_restrictions ON page_id = pr_page
WHERE pr_type = 'edit'
AND page_namespace = 0
AND page_is_redirect = 0
AND pr_expiry = 'infinity' | {"resultsets": [{"headers": ["el_to"], "rowcount": 100000}], "runningtime": "151.35"} | enwiki |
Wikidata - English descriptions starting with "a .." | null | SELECT actor_name as user,
COUNT(*) as cnt
FROM revision
JOIN change_tag
ON rev_id = ct_rev_id
JOIN actor
ON actor_id = rev_actor
WHERE ct_tag_id =
(SELECT ctd_id FROM change_tag_def
WHERE ctd_name = 'mw-reverted')
GROUP BY user
ORDER BY cnt DESC
LIMIT 5; | {"resultsets": [{"headers": ["user", "cnt"], "rowcount": 112}], "runningtime": "0.93"} | enwiki |
Revert rates by edit tags (article namespace) | null | select *, reverted_edit_count/edit_count*100 as percent_reverted
from (
select ctd_name, count(*) as edit_count, count(t.reverted_rev_id) as reverted_edit_count
from change_tag
left join change_tag_def on ct_tag_id=ctd_id
left join revision on ct_rev_id=rev_id
left join page on rev_page=page_id
left joi... | {"resultsets": [{"headers": ["user", "cnt"], "rowcount": 82}], "runningtime": "0.76"} | enwiki_p |
Revert rates by edit tags | null | select *, reverted_edit_count/edit_count*100 as percent_reverted
from (
select ctd_name, count(*) as edit_count, count(t.reverted_rev_id) as reverted_edit_count
from change_tag
left join change_tag_def on ct_tag_id=ctd_id
left join revision on ct_rev_id=rev_id
left join (
select ct_rev_id as reverted_... | {"resultsets": [{"headers": ["el_to", "el_from"], "rowcount": 100000}], "runningtime": "156.78"} | enwiki_p |
T298272 | null | select rc_this_oldid, rc_bot from recentchanges join actor on rc_actor=actor_id where actor_name="Turingbot" order by rc_id desc limit 100; | {"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": 6}, {"headers": ["rc_namespace", "rc_... | fawiki_p |
T295516 What percentage of talk page edits are made with DiscussionTools? (after WikiEditor tag) | null | select *
from (
select tags, count(*) as count
from (
select rev_id, COALESCE(group_concat(ctd_name),'[NO INTERESTING TAGS]') as tags
from revision revision1
left outer join change_tag on rev_id=ct_rev_id
left outer join change_tag_def
on ct_tag_id=ctd_id
-- Ignore this tag because it would be listed in... | {"resultsets": [{"headers": ["date", "page_title"], "rowcount": 0}], "runningtime": "3.88"} | enwiki_p |
mw-undo | null | SELECT actor_name as user,
COUNT(*) as cnt
FROM revision
JOIN change_tag
ON rev_id = ct_rev_id
JOIN actor
ON actor_id = rev_actor
WHERE ct_tag_id =
(SELECT ctd_id FROM change_tag_def
WHERE ctd_name = 'mw-undo')
GROUP BY user
ORDER BY cnt DESC
LIMIT 1000; | {"resultsets": [{"headers": ["cat", "#p", "articles"], "rowcount": 279}], "runningtime": "0.59"} | bnwiki |
Users with most edits in 2021 on svwiki | List of a user's edit times. | WITH groups AS (
SELECT ug_user, GROUP_CONCAT(ug_group) AS memberships
FROM user_groups
GROUP BY ug_user)
SELECT
actor.actor_name AS anv,
memberships AS grupper,
COUNT(rev_id) AS redigeringar
FROM revision LEFT JOIN actor ON (revision.rev_actor = actor.actor_id)
LEFT JOIN groups ON (actor.actor_user = g... | {"resultsets": [{"headers": ["time", "user", "namespace", "page", "comment"], "rowcount": 0}], "runningtime": "0.09"} | svwiki_p |
svwiki edits 2021 (mobile/all) | Based on queries #50040 and #50065. |
set @mobile_edit_tag = (
select
ctd_id
from
change_tag_def
where
ctd_name = 'mobile edit'
);
select
substring(rev_timestamp, 1, 6) as month,
sum(ct_rev_id is not null) as mobile_revisions,
count(rev_id) as revisions,
concat(
if(
count(rev_id) = 0,
0,
format(
sum... | {"resultsets": [{"headers": ["site_group"], "rowcount": 985}], "runningtime": "1.60"} | svwiki_p |
Users with most edits in 2021 on enwiki | List of a user's edit times. | WITH groups AS (
SELECT ug_user, GROUP_CONCAT(ug_group) AS memberships
FROM user_groups
GROUP BY ug_user)
SELECT
actor.actor_name AS anv,
memberships AS grupper,
COUNT(rev_id) AS redigeringar
FROM revision LEFT JOIN actor ON (revision.rev_actor = actor.actor_id)
LEFT JOIN groups ON (actor.actor_user = g... | {"resultsets": [{"headers": ["date", "images"], "rowcount": 95}], "runningtime": "0.32"} | enwiki_p |
blocks per month | null | SELECT COUNT(ipb_id) as "Number of blocks", ipb_timestamp DIV 100000000 as "Month (YYYY MM)"
FROM ipblocks
JOIN comment ON (ipblocks.ipb_reason_id = comment.comment_id)
GROUP BY ipb_timestamp DIV 100000000
ORDER BY ipb_timestamp DESC
LIMIT 500 | {"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": 10}], "runningtime": "0.08"} | enwiki_p |
tt | null | select * from wb_items_per_site limit 10 | {"resultsets": [{"headers": ["page_id"], "rowcount": 0}], "runningtime": "16.81"} | wikibase |
Users creating others' userpages on enwiki, by year | null | SELECT YEAR(log_timestamp), COUNT(*)
FROM logging
JOIN actor ON log_actor = actor_id
WHERE log_type = "create"
AND log_namespace = 2
AND log_title NOT LIKE "%/%"
AND REPLACE(log_title, "_", " ") != actor_name
GROUP BY 1
ORDER BY 1 ASC | {"resultsets": [{"headers": ["user_name", "ug_group"], "rowcount": 7}], "runningtime": "0.09"} | enwiki_p |
Users creating others' userpages on enwiki, a snapshot | null | SELECT log_id, log_timestamp, actor_name, log_title, CONCAT("https://en.wikipedia.org/wiki/User:", log_title)
FROM logging
JOIN actor ON log_actor = actor_id
WHERE log_type = "create"
AND log_namespace = 2
AND log_title NOT LIKE "%/%"
AND REPLACE(log_title, "_", " ") != actor_name
AND log_timestamp LIKE "20210101%" | {"resultsets": [{"headers": ["user_name", "ug_group"], "rowcount": 7}], "runningtime": "0.08"} | enwiki_p |
Sockblocks on enwiki, a snapshot [deprecated] | null | SELECT log_id, log_timestamp, actor_name, log_title, CONCAT("https://en.wikipedia.org/wiki/User:", log_title)
FROM logging
JOIN comment on log_comment_id = comment_id
JOIN actor on log_actor = actor_id
WHERE log_type = "block"
AND log_action = "block"
AND (comment_text LIKE "%ock evasion%" -- Easier than /([Bb]?l|L)ock... | {"resultsets": [{"headers": ["user_name", "ug_group"], "rowcount": 193}], "runningtime": "0.41"} | enwiki_p |
recent edit summary search for URL: updated for December 2021 | null | SELECT rc_title,rc_timestamp,comment_text
FROM recentchanges
JOIN `comment` ON comment_id = rc_comment_id AND comment_text like "%uses US spelling%"
ORDER BY rc_title,rc_timestamp,comment_text | {"resultsets": [{"headers": ["page_title"], "rowcount": 0}], "runningtime": "0.06"} | enwiki_p |
edit summaries containing URL in November 2021 onwards | Example search for a partial edit summary, limited by timestamp.
For [[WP:RAQ#Searching for edit summary text over the revision table]] circa 7 November 2021. | SELECT actor_name, page_namespace, page_title, rev_timestamp, comment_text
FROM revision
JOIN page ON page_id = rev_page
JOIN comment_revision ON comment_id = rev_comment_id
JOIN actor_revision ON actor_id = rev_actor
WHERE comment_text LIKE '%https://en.wikipedia.org/wiki/American_and_British_English_spelling_differen... | {"resultsets": [{"headers": ["page_title"], "rowcount": 776}], "runningtime": "4.76"} | enwiki_p |
Most active AFTv5 reviewers on enwiki | null | SELECT actor_name, COUNT(*)
FROM logging
JOIN actor ON log_actor = actor_id
WHERE log_type = "articlefeedbackv5"
GROUP BY 1
ORDER BY 2 DESC | {"resultsets": [{"headers": ["count(DISTINCT user_name)"], "rowcount": 1}], "runningtime": "0.13"} | enwiki_p |
Sockblocks on enwiki in 2021, users with edits only | null | SELECT MONTH(log_timestamp), COUNT(*)
FROM logging
JOIN comment on log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND log_timestamp LIKE "2021%"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock(?!s4)|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]?[Tt]erm [Aa]buse)"
AND (SELEC... | {"resultsets": [{"headers": ["ar_id", "ar_namespace", "ar_title", "ar_timestamp", "ar_minor_edit", "ar_page_id"], "rowcount": 1791}], "runningtime": "14.44"} | enwiki_p |
Sockblocks on enwiki, users with edits only | null | SELECT YEAR(log_timestamp), COUNT(*)
FROM logging
JOIN comment on log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock(?!s4)|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]?[Tt]erm [Aa]buse)"
AND (SELECT user_editcount
FROM user
... | {"resultsets": [{"headers": ["actor_name", "rc_this_oldid", "comment_text"], "rowcount": 54}], "runningtime": "37.72"} | enwiki_p |
2021 enwiki soccbloccs with 10 or more edits | null | SELECT MONTH(log_timestamp), COUNT(*)
FROM logging
JOIN comment on log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND log_timestamp LIKE "2021%"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock(?!s4)|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]?[Tt]erm [Aa]buse)"
AND (SELEC... | {"resultsets": [{"headers": ["actor_name", "rc_this_oldid", "comment_text"], "rowcount": 57}], "runningtime": "13.84"} | enwiki_p |
2021 enwiki soccbloccs with 1000 or more edits | null | SELECT MONTH(log_timestamp), COUNT(*)
FROM logging
JOIN comment on log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND log_timestamp LIKE "2021%"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock(?!s4)|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]?[Tt]erm [Aa]buse)"
AND (SELEC... | {"resultsets": [{"headers": ["page_title", "cat_pages", "cat_subcats"], "rowcount": 255}], "runningtime": "3.17"} | enwiki_p |
2021 enwiki soccbloccs with at least a thousand edits | null | SELECT MONTH(log_timestamp), COUNT(*)
FROM logging
JOIN comment on log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND log_timestamp LIKE "2021%"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock(?!s4)|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]?[Tt]erm [Aa]buse)"
AND (SELEC... | {"resultsets": [{"headers": ["page_title", "page_len", "cat_pages", "rev_timestamp", "actor_name"], "rowcount": 479}], "runningtime": "114.46"} | enwiki_p |
Sockblocks on enwiki in 2021 | null | SELECT MONTH(log_timestamp), COUNT(*)
FROM logging
JOIN actor ON log_actor = actor_id
JOIN comment on log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND log_timestamp LIKE "2021%"
AND actor_name != "ST47ProxyBot"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock|[Cc]h... | {"resultsets": [{"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title"], "rowcount": 0}, {"headers": ["tl_title"], "rowcount": 0}, {"headers": ["page_title", "rev_timestamp"], "rowcount": 3}, {"headers": ["page_title", "rd_title"], "rowcount": 0}, {"headers": ["page_title", "pp_propname"], "r... | enwiki_p |
Sockblocks on enwiki | null | SELECT YEAR(log_timestamp), COUNT(*)
FROM logging
JOIN actor ON log_actor = actor_id
JOIN comment ON log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND actor_name != "ST47ProxyBot"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]... | {"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": 6}, {"headers": ["rc_namespace", "rc_... | enwiki_p |
LTA2 | null | SELECT
DISTINCT actor_name,
ipb_address,
comment_text,
ipb_timestamp
FROM
ipblocks
INNER JOIN actor ON (ipblocks.ipb_by_actor = actor.actor_id)
INNER JOIN comment ON (ipblocks.ipb_reason_id = comment.comment_id)
WHERE
TRUE
AND ipb_user > 0 -- exclude IPs
AND LOWER(comment_text) LIKE '%Skiyomi%' | {"resultsets": [{"headers": ["Dateiname"], "rowcount": 63}], "runningtime": "276.39"} | enwiki_p |
Non-ASCII usernames active on enwiki | null | SELECT DISTINCT actor_name
FROM recentchanges
JOIN actor ON rc_actor = actor_id
WHERE actor_name RLIKE "[^\\x00-\\x7F]" | {"resultsets": [{"headers": ["user_name", "user_editcount", "user_registration", "Last edit", "user_groups"], "rowcount": 20}], "runningtime": "1.45"} | enwiki_p |
Non-Latin usernames active on enwiki | null | SELECT DISTINCT actor_name
FROM recentchanges
JOIN actor ON rc_actor = actor_id
WHERE actor_name RLIKE "[^\\x00-\\x024F]" | {"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": 6}, {"headers": ["rc_namespace", "rc_... | enwiki_p |
Templatelinks protection checker (unprotected) | Unprotected templates with over 500 transclusions | SELECT
CONCAT("Template:", REPLACE(tl_title, "_", " ")) AS "Unprotected template",
count(*) AS "Uses"
FROM
templatelinks
INNER JOIN page ON page.page_namespace = 10 AND page.page_title = templatelinks.tl_title
WHERE
tl_namespace = 10
AND page.page_id NOT IN (SELECT pr_page FROM page_restrictions WHERE pr_ty... | {"resultsets": [{"headers": ["Tables_in_centralauth_p"], "rowcount": 9}], "runningtime": "0.07"} | enwiki_p |
Templatelinks protection checker (only semi-protected) | Semi-protected templates with over 500 transclusions | SELECT
CONCAT("Template:", REPLACE(tl_title, "_", " ")) AS "Semi-protected template",
count(*) AS "Uses"
FROM
templatelinks
INNER JOIN page ON page.page_namespace = 10 AND page.page_title = templatelinks.tl_title
INNER JOIN page_restrictions ON page.page_id = page_restrictions.pr_page
WHERE
tl_namespace = 1... | {"resultsets": [{"headers": ["log_title", "COUNT(log_id)"], "rowcount": 2283}], "runningtime": "4.06"} | enwiki_p |
ruwiki: List articles having " in their names | null | select page_title, page_is_redirect
from page
where
page_namespace = 0 and
page_title like '%"%'
order by page_is_redirect | {"connection_id": 12579174} | ruwiki_p |
Non-Latin usernames active on enwiki | null | SELECT DISTINCT actor_name
FROM recentchanges
JOIN actor ON rc_actor = actor_id
WHERE actor_name RLIKE "[^\\x00-ɏ]"
| {"resultsets": [{"headers": ["Tables_in_wikidatawiki_p"], "rowcount": 104}], "runningtime": "0.28"} | enwiki_p |
Non-Latin usernames active on enwiki | null | SELECT DISTINCT actor_name,user_editcount
FROM recentchanges
JOIN actor ON rc_actor = actor_id join user on actor_user=user_id
WHERE actor_name RLIKE "[^\\x00-ɏ]"
| {"resultsets": [{"headers": ["page_title", "cl_sortkey", "#p"], "rowcount": 2}], "runningtime": "0.14"} | enwiki_p |
Blocks by DJ | null | SELECT YEAR(log_timestamp), COUNT(*)
FROM logging
JOIN actor ON log_actor = actor_id
JOIN comment ON log_comment_id = comment_id
WHERE log_type = "block"
AND log_action = "block"
AND actor_name != "Dreamy Jazz"
AND comment_text RLIKE "([Bb]?l|L)ock evasion|multiple account|[Ss]ock|[Cc]heck[Uu]ser|[Ll]([Tt][Aa]|ong[- ]?... | {"resultsets": [{"headers": ["title", "redir", "sortkey", "length", "page_latest", "#cat"], "rowcount": 148}], "runningtime": "6.56"} | enwiki_p |
Non-Latin usernames active on enwiki, with editcount and rights | Everyone in RecentChanges with an editcount greater than 0. (Creations are listed in RecentChanges, making a 0 editcount possible.) | SELECT actor_name, user_editcount, GROUP_CONCAT(DISTINCT ug_group SEPARATOR ", ") AS $groups
FROM recentchanges
INNER JOIN actor ON rc_actor = actor_id
INNER JOIN user ON actor_user = user_id
LEFT JOIN user_groups ON user_id = ug_user
WHERE actor_name RLIKE "[^\\x00-ɏ]"
AND user_editcount > 0
GROUP BY 1
ORDER BY 2 DESC | {"resultsets": [{"headers": ["title", "redir", "sortkey", "length", "page_latest", "#cat"], "rowcount": 120}], "runningtime": "4.54"} | enwiki_p |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.