title
stringlengths 1
212
| description
stringlengths 1
4.39k
⌀ | query
stringlengths 1
65.5k
⌀ | extra_info
stringlengths 18
31.6k
| wikidb
stringlengths 4
26
⌀ |
---|---|---|---|---|
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230603000000' # előző hónap eleje
AND log_timestamp < '20230604000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["page_id", "page_title"], "rowcount": 22}], "runningtime": "0.08"} | huwiki_p |
enwiki usernames containing banned characters | null | SELECT COUNT(REGEXP_REPLACE(user_name, "[^%/@:=]", "")) AS instances,
REGEXP_REPLACE(user_name, "[^%/@:=]", "") AS forbidden_characters
FROM user
WHERE (
user_name LIKE "%\%%"
OR user_name LIKE "%/%"
OR user_name LIKE "%@%"
OR user_name LIKE "%:%"
OR user_name LIKE "%=%"
)
GROUP BY 2
ORDER BY 1 DESC | {"resultsets": [{"headers": ["page_title", "page_namespace", "bot users", "bot users named", "last edit on page", "edits"], "rowcount": 12}], "runningtime": "3.05"} | enwiki_p |
en dab pages without dab property | either titled as a dab page or contained in a dab category | USE enwiki_p;
SELECT DISTINCT page_title
FROM page
WHERE page_is_redirect=0
AND page_namespace=0
AND (page_title like "%(disambiguation)"
OR EXISTS (SELECT
1
FROM categorylinks
WHERE cl_from = page_id
AND cl_to like "%isambiguation\_pages%"
)
)
AND NOT EXISTS (
SELECT 1
FROM page_props
WHERE pp_propname = 'disambiguation'
AND pp_page = page_id
)
AND NOT EXISTS (SELECT
1
FROM categorylinks
WHERE cl_from = page_id
AND cl_to like "%et\_index\_articles%"
)
LIMIT 100; | {"resultsets": [{"headers": ["file"], "rowcount": 337}], "runningtime": "0.81"} | enwiki_p |
שרי האלפים שרי המאות, בדיקה של יגאל וביקורת | null | select user_name, count(page_title)
from user join revision_userindex join page join actor
on user_id = actor_user
and rev_page = page_id
and rev_actor = actor_id
where page_namespace = 0
and not page_is_redirect
and rev_parent_id = 0
and rev_deleted = 0
group by user_name
having count(page_title) >= 50
order by count(page_title) desc
| {"resultsets": [{"headers": ["page_title", "page_namespace"], "rowcount": 141}], "runningtime": "0.18"} | hewiki_p |
New Page Reviewers eligible for barnstars - 2022(articles) | null | SELECT actor_name AS `Reviewer`,
COUNT(IF(logtemp.page_is_redirect = 0, 1, NULL)) as `Article Reviews`
FROM (
SELECT distinct log_actor, log_page, page_is_redirect
FROM logging_userindex
JOIN page ON page_title = log_title AND page_namespace = log_namespace
WHERE log_timestamp BETWEEN 20200101000000 AND 20240101000000
AND
((log_type = 'patrol' AND log_action = 'patrol') OR
(log_type = 'pagetriage-curation' AND log_action = 'reviewed'))
AND log_namespace = 0
) logtemp
JOIN actor ON actor_id = log_actor
JOIN user ON actor_user = user_id
left JOIN ipblocks ON ipb_user = user_id
where ipb_sitewide IS NULL
GROUP BY reviewer
HAVING `Article Reviews` >= 100
ORDER BY `Article Reviews` DESC
limit 100; | {"resultsets": [{"headers": ["page_title", "page_namespace"], "rowcount": 54}], "runningtime": "0.10"} | enwiki_p |
SIANOTDAB | A set index article is not a disambiguation page. | select page_title from page
where page_namespace = 0
and page_id in (select cl_from from categorylinks where cl_to = "All_disambiguation_pages")
and page_id in (select cl_from from categorylinks where cl_to = "All_set_index_articles"); | {"resultsets": [{"headers": ["page_title", "page_namespace", "page_is_redirect"], "rowcount": 330}], "runningtime": "0.35"} | enwiki_p |
DAB/SIA redirects in article categories | null | select page_title from page
where page_namespace = 0 and page_is_redirect = 1
and page_id in (select cl_from from categorylinks where cl_to in ("All_disambiguation_pages", "All_set_index_articles")); | {"resultsets": [], "runningtime": "0.04"} | enwiki_p |
List of sysops | null | SELECT user_name AS Username YEAR(user_registration) AS Reg_year
FROM user
INNER JOIN user_groups ON user_id = ug_user AND ug_group = 'editor'
WHERE NOT EXISTS(
SELECT ug_group FROM user_groups WHERE ug_user = user_id AND ug_group = "suppressredirect"
) | {"resultsets": [{"headers": ["Articles with talk page redirects"], "rowcount": 1039}], "runningtime": "38.89"} | ruwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230604000000' # előző hónap eleje
AND log_timestamp < '20230605000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["actor_name"], "rowcount": 93}], "runningtime": "312.58"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230604000000' # előző hónap eleje
AND log_timestamp < '20230605000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"connection_id": 118327769} | huwiki_p |
ruwiki user list | enwiki inactive special users | SELECT * FROM actor
LIMIT 100
; | {"resultsets": [{"headers": ["rev_id", "rev_timestamp", "comment_text"], "rowcount": 189181}], "runningtime": "166.69"} | ruwiki_p |
en dab pages titled (dab) but without link from primary topic | null | USE enwiki_p;
SELECT DISTINCT page_title
FROM page LEFT JOIN pagelinks ON pl_title = page_title AND pl_namespace = page_namespace
WHERE pl_namespace IS NULL
AND page_is_redirect=0
AND page_namespace=0
AND page_title like "%(disambiguation)"; | {"resultsets": [{"headers": ["User", "Edits"], "rowcount": 63}], "runningtime": "0.74"} | enwiki_p |
ruwiki inactive admin users | null | SELECT ug_user, ug_group, user_id, user_name from user_groups, user
WHERE (user_groups.ug_user = user.user_id)
AND
(((ug_group = 'suppressredirect') OR (ug_group = 'editor')))
LIMIT 10000
; | {"resultsets": [{"headers": ["actor_id", "actor_user", "actor_name"], "rowcount": 1}], "runningtime": "0.06"} | ruwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230604000000' # előző hónap eleje
AND log_timestamp < '20230605000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["count(rev_id)", "page_title"], "rowcount": 1}], "runningtime": "0.06"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230604000000' # előző hónap eleje
AND log_timestamp < '20230605000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["count(rev_id)"], "rowcount": 1}], "runningtime": "0.06"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230604000000' # előző hónap eleje
AND log_timestamp < '20230605000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["count(rev_id)", "page_title"], "rowcount": 193}], "runningtime": "0.38"} | huwiki_p |
ja dab pages titled (dab) but without link from primary topic | null | USE jawiki_p;
SELECT DISTINCT page_title
FROM page LEFT JOIN pagelinks ON pl_title = page_title AND pl_namespace = page_namespace
WHERE pl_namespace IS NULL
AND page_is_redirect=0
AND page_namespace=0
AND page_title like "%(曖昧さ回避%"; | {"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", "actor_id", "actor_user", "actor_name", "user_id", "user_name", "user_real_name", "user_password", "user_newpassword", "user_email", "user_touched", "user_token", "user_email_authenticated", "user_email_token", "user_email_token_expires", "user_registration", "user_newpass_time", "user_editcount", "user_password_expires"], "rowcount": 5}], "runningtime": "0.06"} | jawiki_p |
Indef fully protected articles | Stolen from https://wikitech.wikimedia.org/wiki/Help:MySQL_queries/Example_queries#Indefinitely_fully-protected_articles | SELECT
page_is_redirect,
page_title,
user_name,
logs.log_timestamp,
logs.log_comment
FROM page
JOIN page_restrictions ON page_id = pr_page
AND page_namespace = 0
AND pr_type = 'edit'
AND pr_level = 'sysop'
AND pr_expiry = 'infinity'
LEFT JOIN logging AS logs ON logs.log_title = page_title
AND logs.log_namespace = 0
AND logs.log_type = 'protect'
LEFT JOIN `user` ON logs.log_user = user_id
WHERE CASE WHEN (NOT ISNULL(log_timestamp))
THEN log_timestamp = (SELECT MAX(last.log_timestamp)
FROM logging AS last
WHERE log_title = page_title
AND log_namespace = 0
AND log_type = 'protect')
ELSE 1 END; | {"resultsets": [{"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 10}], "runningtime": "0.06"} | enwiki_p |
Potentiell leere Dateiüberprüfungen | null | SELECT CONCAT('[[Wikipedia:', page_title, ']]') AS "Löschkandidat?",
(SELECT COUNT(*) FROM revision WHERE rev_page = page_id) AS "Anzahl Versionen",
(SELECT COUNT(*) FROM revision, actor WHERE rev_page = page_id AND rev_actor = actor_id AND actor_name NOT LIKE "%bot" AND actor_name NOT LIKE "%Bot") AS "Anzahl Versionen ohne Bots"
FROM page LEFT JOIN pagelinks
ON pl_from = page_id
AND pl_namespace = 6
WHERE page_namespace = 4
AND page_title LIKE "Dateiüberprüfung/Dateiüberprüfung%"
AND pl_title IS NULL
ORDER BY page_title DESC | {"resultsets": [{"headers": ["page_title", "temps", "cats"], "rowcount": 0}], "runningtime": "0.04"} | dewiki_p |
Tewiki Date-wise pages published from Content translation | null | use fiwiki_p;
select
substr(rev_timestamp, 1, 8) as Datee,
count(substr(rev_timestamp, 1, 8)) as Translated_articles
from
change_tag,
change_tag_def,
revision,
page
where
ct_tag_id = ctd_id
and rev_id = ct_rev_id
and page_id = rev_page
and page_namespace = 0
and page_is_redirect = 0
and ctd_name = "contenttranslation-v2"
and rev_parent_id = 0
and substr(rev_timestamp, 1, 4) = "2023"
group by substr(rev_timestamp, 1, 8)
order by
rev_timestamp | {"resultsets": [{"headers": ["qid", "type", "lang", "text"], "rowcount": 1918}], "runningtime": "1128.59"} | fiwiki_p |
Articles created by CX in siwiki in 2021 | null | -- When appropriate, change 'contenttranslation' to 'sectiontranslation'
set @cx_edit_tag = (
select
ctd_id
from
change_tag_def
where
ctd_name = 'contenttranslation'
);
SELECT
rev_timestamp,
actor_name,
page_title,
page_namespace,
page_id,
MAX(ct_rev_id)
FROM
`change_tag`,
`revision`,
`actor`,
`page`
WHERE
rev_timestamp like '2023%' AND
ct_tag_id = @cx_edit_tag AND
page_namespace = 0 AND
rev_id = ct_rev_id AND
rev_page = page_id AND
rev_actor = actor_id
GROUP BY
page_id,
rev_timestamp
ORDER BY
rev_timestamp;
| {"resultsets": [{"headers": ["Articles with talk page redirects"], "rowcount": 848}], "runningtime": "34.61"} | fiwiki_p |
get all redirects last | null | use hewikisource_p;
select title as page_title, base_title from (
select 1 as type, p2.page_id as base_id, p.page_id as sub_id, p.page_id as id, p2.page_title as base_title, p.page_title as title from page p
-- where p.page_title not like N'%־%'
left join redirect rd on rd.rd_from = p.page_id and rd.rd_namespace = 0
join page p2 on rd.rd_title = p2.page_title
join categorylinks cat on cat.cl_from = p2.page_id where cat.cl_to="בוט_חוקים"
union
select 0 as type, p.page_id as id, 0 as sub_id, p.page_id as base_id, p.page_title as title, p.page_title as base_title from page p
join categorylinks cat on cat.cl_from = p.page_id where cat.cl_to="בוט_חוקים"
order by type, base_title, base_id, sub_id -- order by type to collect nonredirects first
) as res
-- where not title like '%־%'
-- limit 100 | {"resultsets": [{"headers": ["tl_from", "tl_from_namespace", "tl_target_id"], "rowcount": 10}], "runningtime": "0.04"} | hewikisource_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230605000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["name", "spam"], "rowcount": 100}], "runningtime": "0.16"} | huwiki_p |
Most frequent domains (HeWiki) | This query compiles a list of 1 000 external links (from the main namespace of the French Wikipedia) grouped by website. | USE hewiki_p;
SELECT url, COUNT(*)
FROM (
SELECT SUBSTRING_INDEX(SUBSTRING(el_to, LOCATE('://', el_to) + 3), '/', 1) url
FROM externallinks
WHERE el_from IN (
SELECT page_id
FROM page
WHERE page_namespace = 0
)
) tmp_table
GROUP BY url
HAVING COUNT(*) > 100
ORDER BY COUNT(*) DESC; | {"resultsets": [{"headers": ["CONCAT('# [[\u0986\u09b2\u09be\u09aa:',page_title,']]')"], "rowcount": 16}], "runningtime": "0.07"} | hewiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230605000000' # előző hónap eleje
AND log_timestamp < '20230606000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["now()"], "rowcount": 1}, {"headers": ["rev_id", "rc_timestamp", "actor_name", "rc_title", "comment_text"], "rowcount": 0}], "runningtime": "12.49"} | huwiki_p |
top external links (iswiki) | null | select el_id, count(el_id) from externallinks
group by el_id
HAVING COUNT(*) > 100
ORDER BY COUNT(*) DESC; | {"connection_id": 119421988} | hewiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230605000000' # előző hónap eleje
AND log_timestamp < '20230606000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["Flags", "New articles in a period", "Wikidata item", "Creator", "Date created", "Length"], "rowcount": 102}], "runningtime": "2.34"} | huwiki_p |
Editors of article and talk | null | SET @pageTitle = "רפורמת_לוין";
SET @pageId0 = (SELECT page_id FROM page WHERE page_title = REPLACE(@pageTitle, " ", "_") AND page_namespace = 0 LIMIT 1);
SET @pageId1 = (SELECT page_id FROM page WHERE page_title = REPLACE(@pageTitle, " ", "_") AND page_namespace = 1 LIMIT 1);
SELECT DISTINCT concat("@[[user:",actor_name,"]], ") AS ping/*, COUNT(*) AS Edits*/
FROM revision
LEFT JOIN actor ON rev_actor = actor_id
WHERE rev_page = @pageId0 OR rev_page = @pageId1
GROUP BY actor_name
ORDER BY actor_name; | {"resultsets": [{"headers": ["Flags", "New articles in a period", "Wikidata item", "Creator", "Date created", "Length"], "rowcount": 102}], "runningtime": "1.66"} | hewiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230605000000' # előző hónap eleje
AND log_timestamp < '20230606000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["cat_id", "cat_title", "cat_pages", "cat_subcats", "cat_files"], "rowcount": 10}, {"headers": ["cl_from", "cl_to", "cl_sortkey", "cl_timestamp", "cl_sortkey_prefix", "cl_collation", "cl_type"], "rowcount": 10}, {"headers": ["rc_id", "rc_timestamp", "rc_actor", "rc_namespace", "rc_title", "rc_comment_id", "rc_minor", "rc_bot", "rc_new", "rc_cur_id", "rc_this_oldid", "rc_last_oldid", "rc_type", "rc_source", "rc_patrolled", "rc_ip", "rc_old_len", "rc_new_len", "rc_deleted", "rc_logid", "rc_log_type", "rc_log_action", "rc_params"], "rowcount": 10}, {"headers": ["rc_id", "rc_timestamp", "rc_actor", "rc_namespace", "rc_title", "rc_comment_id", "rc_minor", "rc_bot", "rc_new", "rc_cur_id", "rc_this_oldid", "rc_last_oldid", "rc_type", "rc_source", "rc_patrolled", "rc_ip", "rc_old_len", "rc_new_len", "rc_deleted", "rc_logid", "rc_log_type", "rc_log_action", "rc_params"], "rowcount": 10}, {"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.19"} | huwiki_p |
ja dab pages without dab property | either titled as a dab page or contained in a dab category | USE jawiki_p;
SELECT DISTINCT page_title
FROM page
JOIN categorylinks
ON cl_from = page_id
WHERE page_is_redirect = 0
AND page_namespace = 0
AND (page_title like "%(曖昧さ回避%"
OR cl_to like "%曖昧さ回避"
OR cl_to like "同名の%"
)
AND NOT EXISTS (
SELECT 1
FROM page_props
WHERE pp_propname = 'disambiguation'
AND pp_page = page_id
) | {"resultsets": [{"headers": ["cl_to"], "rowcount": 8651}], "runningtime": "286.02"} | jawiki_p |
WikiDaheim users 2023 (by first revision, by uploader) | Uploads by users for WikiDaheim 2023 (only first revisions) | SELECT /* SLOW_OK */ DISTINCT actor_name AS user, COUNT(image.img_name) as img_count
FROM actor, revision, image, page, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND actor.actor_id = revision.rev_actor
AND image.img_name = page.page_title
and revision.rev_page = page.page_id
and revision.rev_parent_id = 0
AND categorylinks.cl_to = "Media_from_WikiDaheim_2023_in_Austria/all"
GROUP BY user
ORDER BY img_count DESC limit 300; | {"resultsets": [{"headers": ["tl_from", "tl_from_namespace", "tl_target_id", "page_id", "page_namespace", "page_title", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang", "lt_id", "lt_namespace", "lt_title"], "rowcount": 0}], "runningtime": "1.65"} | commonswiki_p |
ja DAB pages receiving links | null | USE jawiki_p;
SELECT DISTINCT CONCAT ('# [[',page_title,']]'),COUNT(pl_from)
FROM pagelinks JOIN page ON pl_title=page_title
WHERE page_is_redirect=0
AND page_namespace=0
AND page_id IN (
SELECT pp_page
FROM page_props
WHERE pp_propname = 'disambiguation'
)
AND pl_from IN (
SELECT page_id
FROM page
WHERE page_is_redirect=0
AND pl_from_namespace=0
)
AND pl_namespace=0
GROUP BY pl_title HAVING COUNT(pl_from) > 5
ORDER BY COUNT(pl_from) DESC; | {"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": 1}], "runningtime": "0.06"} | jawiki_p |
WikiDaheim 2023 media by date | null | SELECT /* SLOW_OK */ DATE_FORMAT(DATE_ADD(img_timestamp, INTERVAL 2 Hour),'%Y-%m-%d') AS date, COUNT(image.img_name) as images
FROM image, page, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND image.img_name = page.page_title
AND categorylinks.cl_to = "Media_from_WikiDaheim_2023_in_Austria/all"
AND img_timestamp BETWEEN 20230630220000 AND 20231008220000
GROUP BY date desc; | {"resultsets": [{"headers": ["URL"], "rowcount": 1}], "runningtime": "71.90"} | commonswiki_p |
WikiDaheim correctors 2023 (after first revision) | Count the number of edits on WikiDaheim images after upload done by users other than the uploader. | #USE commonswiki_p;
SELECT /* SLOW_OK */ DISTINCT actor_name AS user, COUNT(revision.rev_parent_id) as edit_count
FROM actor, /*user_groups,*/ revision, revision as revision0, image, page, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND actor.actor_id = revision.rev_actor
AND image.img_name = page.page_title
and revision.rev_page = page.page_id
and revision.rev_parent_id > 0
and revision0.rev_parent_id = 0
and revision.rev_page = revision0.rev_page
and revision.rev_actor != revision0.rev_actor
# LOWER does not work
AND actor_name NOT LIKE "%bot%" AND actor_name NOT LIKE "%Bot%"
/*and user_groups.ug_user = actor.actor_id
and user_groups.ug_group != 'bot'*/
AND categorylinks.cl_to = "Media_from_WikiDaheim_2023_in_Austria/all"
GROUP BY user
ORDER BY edit_count DESC limit 200; | {"resultsets": [{"headers": ["page_namespace", "page_id", "page_title", "page_is_redirect", "page_len"], "rowcount": 6}], "runningtime": "71.46"} | commonswiki |
WikiDaheim 2023 media out of date | null | SELECT /* SLOW_OK */ DATE_FORMAT(DATE_ADD(rev_timestamp, INTERVAL 2 Hour),'%Y-%m-%d') AS date, page.page_title
FROM image, page, revision, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND image.img_name = page.page_title
and revision.rev_page = page.page_id
and revision.rev_parent_id = 0
AND categorylinks.cl_to = "Media_from_WikiDaheim_2023_in_Austria/all"
AND (rev_timestamp < 20230630220000 or rev_timestamp > 20231008220000)
; | {"resultsets": [{"headers": ["Articles with talk page redirects"], "rowcount": 822}], "runningtime": "26.23"} | commonswiki_p |
WikiDaheim Constraints 2023 | check the 2 MPixel minimum requirement | #USE commonswiki_p;
SELECT /* SLOW_OK */ image.img_name, image.img_media_type, image.img_height, image.img_width, (image.img_height * image.img_width) as size
FROM image, page, categorylinks
WHERE page.page_id=categorylinks.cl_from
AND image.img_name = page.page_title
and image.img_media_type NOT IN ('AUDIO', 'VIDEO')
AND categorylinks.cl_to = "Media_from_WikiDaheim_2023_in_Austria/all"
and image.img_height * image.img_width < 2*1000*1000
and NOT EXISTS( SELECT * FROM categorylinks AS categorylinks2
WHERE page.page_id=categorylinks2.cl_from
and categorylinks2.cl_to = "Media_from_WikiDaheim_2023_in_Austria_not_for_prejury"
)
GROUP BY size; | {"resultsets": [{"headers": ["Page title"], "rowcount": 74662}], "runningtime": "137.93"} | commonswiki |
nov 2019 new pages tewiki_v2 | tewiki page creations in month, 2019 | SELECT page_title
FROM revision
JOIN page ON page_id = rev_page
WHERE rev_timestamp LIKE '201912%'
AND rev_parent_id = 0
AND page_namespace = 0
AND page_is_redirect = 0 | {"connection_id": 173590696} | tewiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230605000000' # előző hónap eleje
AND log_timestamp < '20230607000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["year", "month", "avg_edit_count"], "rowcount": 22}, {"headers": ["year", "month", "avg_edit_count"], "rowcount": 24}, {"headers": ["year", "month", "avg_edit_count"], "rowcount": 27}, {"headers": ["year", "month", "avg_edit_count"], "rowcount": 26}], "runningtime": "11.40"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230605000000' # előző hónap eleje
AND log_timestamp < '20230607000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["page_title", "page_namespace"], "rowcount": 4}], "runningtime": "0.06"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230606000000' # előző hónap eleje
AND log_timestamp < '20230607000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["pl_2_title", "counts"], "rowcount": 3}], "runningtime": "36.60"} | huwiki_p |
Miscategorized DAB/SIA | null | /*
with recursive subcats (cat_title) as (
select distinct cl_to from categorylinks where cl_to in ('Disambiguation_pages')
union all
select page_title from subcats, categorylinks, page
where cl_type = 'subcat' and cl_from = page_id and cl_to = cat_title and page_title != 'All_disambiguation_pages'
)
select distinct page_namespace, page_title from subcats
join categorylinks on cl_to = cat_title and cl_type != 'subcat'
join page on cl_from = page_id
and page_id not in (select cl_from from categorylinks where cl_to = 'All_disambiguation_pages' and cl_type != 'subcat')
order by page_namespace;
*/
with recursive subcats (cat_title) as (
select distinct cl_to from categorylinks where cl_to in ('Set_index_articles')
union all
select page_title from subcats, categorylinks, page
where cl_type = 'subcat' and cl_from = page_id and cl_to = cat_title and page_title != 'All_set_index_articles'
)
select distinct page_namespace, page_title from subcats
join categorylinks on cl_to = cat_title and cl_type != 'subcat'
join page on cl_from = page_id
and page_id not in (select cl_from from categorylinks where cl_to = 'All_set_index_articles' and cl_type != 'subcat')
order by page_namespace; | {"resultsets": [{"headers": ["Q_id"], "rowcount": 2346}], "runningtime": "3.43"} | enwiki_p |
উইকিপিডিয়ার শীর্ষ সম্পাদকগণ | ১৫-০৫-২০২২। উপাত্ত ডাউনলোড করতে, উপাত্ত ডাউনলোড থেকে wikitable ক্লিক করুন। | SET @counter:=0;
SELECT
CONCAT("{{subst:formatnum:",@counter:=@counter+1,"}}") AS নং,
CONCAT("{{u|",user_name,"}}") AS ব্যবহারকারী_নাম,
CONCAT("{{subst:formatnum:",user_editcount,"}}") AS সম্পাদনার_সংখ্যা
FROM user
WHERE user_id NOT IN (SELECT ug_user FROM user_groups WHERE ug_group = 'bot')
AND user_name NOT RLIKE "(.*)([Bb][Oo][Tt])(.*)"
ORDER BY user_editcount DESC LIMIT 1000; | {"resultsets": [{"headers": ["COUNT( DISTINCT linter_page )"], "rowcount": 1}], "runningtime": "0.07"} | bnwiki |
Total and reverted revisions of [[en:List of WWE personnel]] | null | SELECT
COUNT(*) AS total,
COUNT(DISTINCT rev_sha1) AS unreverted,
COUNT(*) - COUNT(DISTINCT rev_sha1) AS reverted
FROM revision
WHERE rev_page = (
SELECT page_id
FROM page
WHERE page_namespace = 0
AND page_title = 'List_of_WWE_personnel'
); | {"connection_id": 130541000} | enwiki |
Match category with template | null | /*
select cat_title, to_base64(cat_title) from category
where cat_title not in (select page_title from page where page_namespace = 14) and cat_pages = 0;
*/
select page_namespace, page_title from page
where page_id in (select cl_from from categorylinks where cl_to = 'Disambiguation_categories')
and page_id not in (select tl_from from templatelinks where tl_target_id in (
select lt_id from linktarget where lt_title = 'Category_disambiguation' and lt_namespace = 10
))
order by page_namespace | {"resultsets": [{"headers": ["actor_name", "page_title", "comment_text", "rev_timestamp", "rev_len"], "rowcount": 0}], "runningtime": "0.19"} | enwiki_p |
Total and reverted revisions of pages with most revisions | null | SELECT
page_title,
COUNT(*) AS total,
COUNT(DISTINCT rev_sha1) AS unreverted,
COUNT(*) - COUNT(DISTINCT rev_sha1) AS reverted,
100 * (1 - COUNT(DISTINCT rev_sha1) / COUNT(*)) AS percentReverted
FROM revision
JOIN page ON rev_page = page_id
WHERE page_namespace = 0
AND page_title IN (
'List_of_WWE_personnel',
'George_W._Bush',
'United_States',
'Donald_Trump',
'Wikipedia',
'List_of_current_UFC_fighters',
'Michael_Jackson',
'Jesus',
'List_of_programs_broadcast_by_ABS-CBN',
'ATP_Tour_records'
)
GROUP BY page_title
ORDER BY COUNT(*) DESC; | {"connection_id": 174495450} | enwiki |
Userspace pages of non-existent users (no talk, no subpages) | null | SELECT CONCAT('https://en.wikipedia.org/wiki/User:', p.page_title) AS URL
FROM enwiki_p.page p
LEFT JOIN enwiki_p.user u ON REPLACE(p.page_title, '_', ' ') = u.user_name
WHERE p.page_namespace = 2
AND u.user_id IS NULL
AND p.page_is_redirect = 0
AND NOT IS_IPV4(p.page_title) -- Exclude IPv4
AND NOT IS_IPV6(p.page_title) -- Exclude IPv6
AND p.page_title NOT LIKE '%.css'
AND p.page_title NOT LIKE '%.cs'
AND p.page_title NOT LIKE '%.js'
AND p.page_title NOT LIKE '%.charset'
AND p.page_title NOT LIKE '%.%.%.xxx'
AND p.page_title NOT IN ('Unknown_user', 'Global_rename_script', 'Sec\"\'27\\u00226\\x3ETest_(WMF)') -- Exclude technical user pages
AND p.page_id NOT IN (
SELECT cl.cl_from FROM
enwiki_p.categorylinks cl
WHERE cl.cl_to IN ('User_soft_redirects', 'Wikipedia_doppelganger_accounts', 'Wikipedia_alternative_accounts') -- Exclude these categories
)
AND p.page_id NOT IN (
SELECT tl.tl_from FROM
enwiki_p.templatelinks tl
WHERE tl.tl_target_id IN (32197, 277052, 282063, 115252, 1968835) -- Exclude pages tagged with sockpuppet template
)
AND p.page_title NOT LIKE '%/%' | {"resultsets": [{"headers": ["Title created", "Time created", "Editor created", "Title deleted", "Time deleted"], "rowcount": 0}], "runningtime": "0.06"} | enwiki_p |
Recursion on categorylinks | null | -- set max_recursive_iterations=10;
with recursive subcats (cat_title) as (
select cl_to from categorylinks where cl_to in ('Lists')
-- union all
union distinct
select page_title from subcats
join categorylinks on cl_to = cat_title and cl_type = 'subcat'
join page on cl_from = page_id
)
-- cycle cat_title restrict
select count(cat_title) from subcats;
-- select min(depth), max(depth), cat_title, count(*) from subcats group by cat_title order by count(depth) desc limit 10;
/*
select count(cat_title) from subcats
where cat_title not rlike 'list|set_index_article|glossar|timeline|family_tree' collate utf8_general_ci;
*/
/*
select count(distinct cl_from) from subcats
join categorylinks on cl_to = cat_title and cl_type != 'subcat'
-- where cat_title not in (select cat_title from category where cat_pages = 0)
-- join page on cl_from = page_id
-- order by page_namespace;
*/
/*
select count(distinct page_id) from subcats
join categorylinks on cl_to = cat_title and cl_type = 'page'
join page on cl_from = page_id and page_namespace = 0
*/ | {"resultsets": [{"headers": ["Title created", "Time created", "Editor created", "Title deleted", "Time deleted", "Edit summary"], "rowcount": 0}], "runningtime": "0.05"} | enwiki_p |
CSD G14 redirects watchlist | null | /*
select count(distinct page_id) from category
join categorylinks on cl_to = cat_title and cl_type = 'page'
join page on cl_from = page_id and page_namespace = 0
where cat_title rlike '^list|[^a-z]list' collate utf8_general_ci
or cat_title in ("All_disambiguation_pages", "All_set_index_articles");
*/
select p1.page_title, p2.page_title from redirect
join page p1 on p1.page_id = rd_from and p1.page_is_redirect = 1 and p1.page_namespace = 0
join page p2 on p2.page_title = rd_title and p2.page_namespace = rd_namespace and p2.page_is_redirect = 0 and p2.page_namespace = 0
where rd_namespace = 0 and p1.page_title like "%\_(disambiguation)"
and p2.page_id not in (
select cl_from from category
join categorylinks on cl_to = cat_title and cl_type = 'page'
where cat_title rlike '^list|[^a-z]list' collate utf8_general_ci
or cat_title in ("All_disambiguation_pages", "All_set_index_articles")
); | {"resultsets": [], "runningtime": "0.02"} | enwiki_p |
Reverse recursion on categorylinks | null | set max_recursive_iterations=0;
with recursive subcats (path, cat_title) as (
-- select page_title, page_title from page where page_title = 'Extraterrestrial_lakes' and page_namespace = 14
select cl_to, cl_to from categorylinks where cl_type = 'page' and cl_from in (
select page_id from page where page_title = 'Harold_Hunter_Armstrong' and page_namespace = 0
)
union all
select concat(path, ',', cl_to), cl_to from subcats
join page on page_title = cat_title and page_namespace = 14
join categorylinks on cl_from = page_id and cl_type = 'subcat'
)
-- cycle cat_title restrict
select * from subcats
-- where find_in_set('Lists', path); | {"resultsets": [{"headers": ["CONCAT(\"* [[\",article.page_title, \"]]\")"], "rowcount": 2837}], "runningtime": "570.90"} | enwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230607000000' # előző hónap eleje
AND log_timestamp < '20230608000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["pp_page", "pp_propname", "pp_value", "pp_sortkey"], "rowcount": 1000}], "runningtime": "0.79"} | huwiki_p |
growth edit summaries | null | SELECT rev_id, rev_timestamp, comment_text
FROM change_tag
JOIN revision
ON rev_id=ct_rev_id
JOIN comment
ON comment_id=rev_comment_id
WHERE
ct_tag_id=(SELECT ctd_id FROM change_tag_def WHERE ctd_name="newcomer task add link")
AND comment_text LIKE "Návrhy odkazů%"
ORDER BY rev_id DESC
LIMIT 20 | {"resultsets": [{"headers": ["Page", "Is redirect?", "Moved timestamp"], "rowcount": 49}], "runningtime": "119.87"} | mlwiki |
Wikidata items with their own item ID as label, description or alias | null | SELECT wbx_text, wby_name, wbxl_language
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
WHERE (
wbx_text LIKE 'Q1%'
OR wbx_text LIKE 'Q2%'
OR wbx_text LIKE 'Q3%'
OR wbx_text LIKE 'Q4%'
OR wbx_text LIKE 'Q5%'
OR wbx_text LIKE 'Q6%'
OR wbx_text LIKE 'Q7%'
OR wbx_text LIKE 'Q8%'
OR wbx_text LIKE 'Q9%'
)
AND CONCAT('Q', wbit_item_id) = wbx_text; | {"resultsets": [{"headers": ["pl_title"], "rowcount": 20}], "runningtime": "2138.43"} | wikidatawiki_p |
إيجاد روابط مدونة بلوجر | null | select page.page_title,el_to from externallinks
join page on page.page_id = externallinks.el_from
where el_to like "%blogspot.com%"
and el_to not like "%web.archive.org%"
and page.page_namespace in (0); | {"resultsets": [{"headers": ["first_title", "second_title"], "rowcount": 1378}], "runningtime": "897.66"} | arwiki_p |
Inactive talkpages of non-blocked inactive IPs | IP talkpages that have not been edited in the last 5 years, the IP is not currently blocked and there have been no edits from that IP in the last 5 years. Also checks for range blocks | select CONCAT('[[User talk:', page_title, ']]') as 'IP talkpage' -- format as wikilink so that it can be read by AWB
from page
join revision on rev_id = page_latest and rev_timestamp < '20180314' -- latest page edit is older than the given date
join actor on actor_user is null and actor_name = page_title -- IP with User talk page
where page_namespace = 3 -- User talk namespace
and page_title like '24.2%' -- Temporary restriction to make query small enough to terminate
-- and page_title regexp '^(\\d{1,3}(\\.\\d{1,3}){3}|[\\dA-F]{1,4}(:[\\dA-F]{0,4}){1,7})$' -- IPv4 and IPv6 regex
-- and page_title regexp '^([\\dA-F]{1,4}(:[\\dA-F]{0,4}){1,7})$' -- IPv6 regex
and not exists (select 1 -- Check that the IP is not blocked
from ipblocks
where ipb_user = 0 -- Blocked user is an IP
and HEX(INET6_ATON(page_title)) between ipb_range_start and ipb_range_end) -- Hex of IP address to check for range blocks
and not exists (select 1 -- Check that the IP is inactive
from revision_userindex
where rev_actor = actor_id -- Choose same IP user as above
and rev_timestamp >= '20180314') -- not edited since this timestamp
-- order by page_title asc -- get pages in ascending order
limit 2000; | {"resultsets": [{"headers": ["declined_then_deleted", "actor_name"], "rowcount": 164}], "runningtime": "26.01"} | enwiki |
Orphaned sandboxes | null | select p1.page_namespace, p1.page_title from page p1
where p1.page_namespace in (10, 828) and p1.page_is_redirect = 0
and p1.page_title rlike "/sandbox[^/]*" collate utf8_general_ci
and substring_index(p1.page_title, '/', 1) not in (
select p2.page_title from page p2 where p2.page_namespace = p1.page_namespace
)
and regexp_replace(p1.page_title, '/sandbox[^/]*', '') not in (
select p2.page_title from page p2 where p2.page_namespace = p1.page_namespace
)
limit 100; | {"resultsets": [{"headers": ["date", "reviews", "accepts", "declines", "rejects", "accept %", "decline %", "reject %"], "rowcount": 31}], "runningtime": "22.23"} | enwiki |
Match page property with category | null | /*
select count(*), page_namespace from page
where page_title like '%/%' and page_is_redirect = 0 and page_namespace not in (2, 3)
group by page_namespace
order by page_namespace;
*/
/*
select page_title from page
where page_title like '%/%' and page_is_redirect = 0 and page_namespace = 0
limit 100;
*/
select page_namespace, page_title, page_is_redirect from page
where page_id in (select pp_page from page_props where pp_propname = "disambiguation")
and page_id not in (select cl_from from categorylinks where cl_to = "All_disambiguation_pages")
and page_namespace != 2
order by page_namespace
/*
select page_title, page_props.* from page_props
join page on page_id = pp_page and page_namespace = 0
where pp_propname = "disambiguation"
limit 100;
*/ | {"resultsets": [{"headers": ["reviews", "actor_name", "accept", "decline", "reject", "accept %", "decline %", "reject %", "Blocked"], "rowcount": 176}], "runningtime": "22.31"} | enwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230607000000' # előző hónap eleje
AND log_timestamp < '20230607000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"connection_id": 175288661} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230607000000' # előző hónap eleje
AND log_timestamp < '20230608000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["lt_title"], "rowcount": 17}], "runningtime": "10.16"} | huwiki_p |
Articles without talk pages | March 2023 execution time: 267 seconds, resultset 79538 rows | SELECT
page_title
FROM
page AS articles
LEFT JOIN page_props ON pp_page = articles.page_id
AND pp_propname = 'disambiguation'
WHERE
articles.page_namespace = 0
AND articles.page_is_redirect = 0
AND pp_page IS NULL
AND NOT EXISTS (
SELECT
1
FROM
page AS talk
WHERE
talk.page_namespace = 1
AND talk.page_title = articles.page_title
)
AND NOT EXISTS (
SELECT
1
FROM
templatelinks
JOIN linktarget ON lt_id = tl_target_id
WHERE
tl_from = articles.page_id
AND lt_namespace = 10
AND (
lt_title IN (
"Wi",
"Surname",
"Given_name",
"Animal_common_name",
"Plant_common_name",
"Nickname",
"Dmbox"
)
OR (lt_title LIKE "%index%")
OR (lt_title LIKE "%redirect%")
)
)
AND NOT (page_title LIKE "List_of_%")
AND NOT (page_title LIKE "Lists_of_%")
AND NOT EXISTS (
SELECT
cl_to
FROM
categorylinks
WHERE
articles.page_id = cl_from
AND (
cl_to IN (
"Temporary_maintenance_holdings",
"Candidates_for_speedy_deletion",
"Requested_RD1_redactions"
)
OR cl_to LIKE "%redirects%"
OR cl_to LIKE "Redirects%"
OR cl_to LIKE "Lists_of_%"
)
)
ORDER BY page_title
LIMIT 50 | {"resultsets": [], "runningtime": "0.03"} | enwiki_p |
Articles with talk pages but not assigned to WikiProjects | Detects articles with talk pages that are not assigned to any Wikiprojects;
Note: deliberately ignores the special case of non-redirect pages with talk page redirects; these will be dealt with at the target talk page anyway
March 2023 execution time: 1226 seconds, resultset 68670 rows | SELECT
article.page_title
FROM
page AS article
LEFT JOIN page_props ON pp_page = article.page_id
AND pp_propname = 'disambiguation'
INNER JOIN page AS talk ON talk.page_title = article.page_title
WHERE
article.page_namespace = 0
AND talk.page_namespace = 1
AND pp_page IS NULL
AND article.page_is_redirect = 0
AND talk.page_is_redirect = 0
AND NOT (article.page_title LIKE "List_of_%")
AND NOT (article.page_title LIKE "Lists_of_%")
AND NOT EXISTS (
SELECT
1
FROM
categorylinks
WHERE
article.page_id = cl_from
AND (
cl_to IN (
"Temporary_maintenance_holdings",
"Candidates_for_speedy_deletion",
"Requested_RD1_redactions"
)
OR cl_to LIKE "%_names"
OR cl_to LIKE "%_surnames"
OR cl_to LIKE "Lists_of_%"
)
)
AND NOT EXISTS (
SELECT
1
FROM
templatelinks
JOIN linktarget ON lt_id = tl_target_id
WHERE
tl_from = article.page_id
AND lt_namespace = 10
AND (
lt_title IN (
"Wi",
"Surname",
"Given_name",
"Animal_common_name",
"Plant_common_name",
"Nickname",
"Dmbox"
)
OR lt_title LIKE "%index%"
OR lt_title LIKE "%redirect%"
)
)
AND NOT EXISTS (
SELECT
1
FROM
categorylinks
WHERE
talk.page_id = cl_from
AND (
cl_to LIKE "%WikiProject_%"
OR cl_to LIKE "%-Class_%_articles"
OR cl_to LIKE "%-importance_%_articles"
OR cl_to LIKE "%-priority_%_articles"
OR cl_to LIKE "Unassessed_%_articles"
)
)
AND NOT EXISTS (
SELECT
1
FROM
templatelinks
JOIN linktarget ON lt_id = tl_target_id
WHERE
tl_from = talk.page_id
AND lt_namespace = 10
AND (lt_title LIKE "%WikiProject_%")
)
ORDER BY article.page_title
LIMIT 50 | {"resultsets": [{"headers": ["\u547d\u540d\u7a7a\u95f4\u7f16\u53f7", "\u9875\u9762\u540d\u79f0"], "rowcount": 3178}], "runningtime": "6.72"} | enwiki_p |
Pagelinks containing URLs | null | SELECT page_namespace, page_title, pl_namespace, pl_title
FROM pagelinks JOIN page ON page_id = pl_from and page_namespace = pl_from_namespace
WHERE pl_title RLIKE '://' and pl_from_namespace in (0, 6, 118)
and pl_title != 'The_Unexplored_Summon://Blood-Sign'; | {"resultsets": [{"headers": ["link"], "rowcount": 2051}], "runningtime": "1.75"} | enwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230607000000' # előző hónap eleje
AND log_timestamp < '20230608000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"connection_id": 175343239} | huwiki_p |
Low resolution images in vital articles | null | SELECT img_name AS Image, Pa.page_title AS Article, CASE WHEN tl_from THEN "NonFree" ELSE "" END AS "Licence"
FROM page Pv
JOIN pagelinks ON pl_from = Pv.page_id AND pl_namespace=0
JOIN page Pa ON Pa.page_namespace=0 AND Pa.page_title=pl_title
JOIN imagelinks ON il_from = Pa.page_id
JOIN image ON img_name = il_to AND img_width < 1000 AND img_height < 1000 AND img_name NOT REGEXP "\.(svg|ogg|mid)$" AND img_name != "Blank.png"
JOIN page Pi ON Pi.page_namespace=6 AND Pi.page_title=img_name
LEFT JOIN templatelinks ON tl_from=Pi.page_id AND tl_target_id= (SELECT lt_id FROM linktarget WHERE lt_namespace=10 AND lt_title="Non-free_media")
WHERE Pv.page_namespace=4 AND Pv.page_title="Vital_articles"
ORDER BY Image, Article | {"resultsets": [{"headers": ["Redirects to disambiguation pages that aren't disambiguation pages"], "rowcount": 0}], "runningtime": "0.05"} | enwiki_p |
(Dab)pages without incoming links from primary topic | null | with article_redirect as (
select p1.page_title, rd_title, p2.page_id as rd_id from redirect
join page p1 on rd_from = p1.page_id and p1.page_namespace = 0 and p1.page_is_redirect = 1
join page p2 on rd_title = p2.page_title and p2.page_namespace = 0 and p2.page_is_redirect = 0
where rd_namespace = 0
)
(select p1.page_title as disamb_title, p2.page_title as primary_topic from page p1
join page p2 on p2.page_namespace = 0 and p2.page_is_redirect = 0
and p2.page_title = substring(p1.page_title, 1, INSTR(p1.page_title, "_(disambiguation)")-1)
where p1.page_title like '%\_(disambiguation)' and p1.page_namespace = 0 and p1.page_is_redirect = 0
and not exists (
select 1 from pagelinks where pl_from = p2.page_id and pl_namespace = 0 and pl_from_namespace = 0
and (pl_title = p1.page_title or pl_title in (
select ar1.page_title from article_redirect ar1 where ar1.rd_title = p1.page_title
))
))
union
(select p1.page_title as disamb_title, ar1.rd_title as primary_topic from page p1
join article_redirect ar1 on ar1.page_title = substring(p1.page_title, 1, INSTR(p1.page_title, "_(disambiguation)")-1)
where p1.page_title like '%\_(disambiguation)' and p1.page_namespace = 0 and p1.page_is_redirect = 0
and not exists (
select 1 from pagelinks where pl_from = ar1.rd_id and pl_namespace = 0 and pl_from_namespace = 0
and (pl_title = p1.page_title or pl_title in (
select ar2.page_title from article_redirect ar2 where ar2.rd_title = p1.page_title
))
))
/*
SELECT page_title FROM page
WHERE page_title NOT IN (select pl_title from pagelinks where pl_namespace = 0 and pl_from_namespace = 0)
AND page_is_redirect = 0 AND page_namespace = 0 AND page_title like "%\_(disambiguation)";
*/
/*
select page_title from page
where page_title like "%\_(disambiguation)" and page_namespace = 0 and page_is_redirect = 0
and page_id not in (select cl_from from categorylinks where cl_to = "All_disambiguation_pages");
*/
/*
select p1.page_title, p2.page_title from redirect
join page p1 on p1.page_id = rd_from and p1.page_is_redirect = 1 and p1.page_namespace = 0
join page p2 on p2.page_title = rd_title and p2.page_namespace = rd_namespace
and p2.page_is_redirect = 0 and p2.page_namespace = 0
where rd_namespace = 0 and p1.page_title like "%\_(disambiguation)"
and p2.page_id not in (
select cl_from from categorylinks
where cl_to in ("All_disambiguation_pages", "All_set_index_articles") and cl_type = 'page'
);
*/ | {"resultsets": [{"headers": ["Redirects to disambiguation pages that aren't disambiguation pages"], "rowcount": 60}], "runningtime": "0.10"} | enwiki_p |
(Dab)pages without outgoing links to primary topic | null | with article_redirect as (
select page_title, rd_title from redirect
join page on rd_from = page_id and page_namespace = 0 and page_is_redirect = 1
where rd_namespace = 0
)
(select p1.page_title as disamb_title, p2.page_title as primary_topic from page p1
join page p2 on p2.page_namespace = 0 and p2.page_is_redirect = 0
and p2.page_title = substring(p1.page_title, 1, INSTR(p1.page_title, "_(disambiguation)")-1)
where p1.page_title like '%\_(disambiguation)' and p1.page_namespace = 0 and p1.page_is_redirect = 0
and not exists (
select 1 from pagelinks where pl_from = p1.page_id and pl_namespace = 0 and pl_from_namespace = 0
and (pl_title = p2.page_title or pl_title in (
select ar1.page_title from article_redirect ar1 where ar1.rd_title = p2.page_title
))
))
union
(select p1.page_title as disamb_title, ar1.rd_title as primary_topic from page p1
join article_redirect ar1 on ar1.page_title = substring(p1.page_title, 1, INSTR(p1.page_title, "_(disambiguation)")-1)
where p1.page_title like '%\_(disambiguation)' and p1.page_namespace = 0 and p1.page_is_redirect = 0
and not exists (
select 1 from pagelinks where pl_from = p1.page_id and pl_namespace = 0 and pl_from_namespace = 0
and (pl_title = ar1.rd_title or pl_title in (
select ar2.page_title from article_redirect ar2 where ar2.rd_title = ar1.rd_title
))
)) | {"resultsets": [{"headers": ["Redirects to disambiguation pages that aren't disambiguation pages"], "rowcount": 0}], "runningtime": "0.05"} | enwiki_p |
reverted translations | null | SELECT
r.*,
page_title,
ctd_name
FROM
change_tag ct
LEFT JOIN revision r
ON ct.ct_rev_id = r.rev_id
LEFT JOIN page p
ON r.rev_page = p.page_id
LEFT JOIN change_tag_def tdef
ON ct.ct_tag_id = tdef.ctd_id
WHERE
YEAR(rev_timestamp) = 2021 AND
MONTH(rev_timestamp) = 11 AND
DAY(rev_timestamp) = 30 AND
HOUR(rev_timestamp) = 21 AND
rev_parent_id = 0 AND
ctd_name IN ('contenttranslation', 'contenttranslation-v2', 'sectiontranslation', 'mw-manual-revert', 'mw-reverted') | {"resultsets": [{"headers": ["actor_name", "actor_user", "page_title", "comment_text", "rev_timestamp", "page_id"], "rowcount": 29}], "runningtime": "0.08"} | dewiki_p |
Pages edited by Esoptr0n | Pages edited by User:Esoptr0n.
For [[WP:Help desk#List of all Wikipedia pages I've added references to?]] circa 8 June 2023. | SELECT DISTINCT CONCAT('[[', CASE page_namespace
WHEN -2 THEN 'Media:' WHEN -1 THEN 'Special:'
WHEN 0 THEN '' WHEN 1 THEN 'Talk:'
WHEN 2 THEN 'User:' WHEN 3 THEN 'User talk:'
WHEN 4 THEN 'Wikipedia:' WHEN 5 THEN 'Wikipedia talk:'
WHEN 6 THEN ':File:' WHEN 7 THEN 'File talk:'
WHEN 8 THEN 'MediaWiki:' WHEN 9 THEN 'MediaWiki talk:'
WHEN 10 THEN 'Template:' WHEN 11 THEN 'Template talk:'
WHEN 12 THEN 'Help:' WHEN 13 THEN 'Help talk:'
WHEN 14 THEN ':Category:' WHEN 15 THEN 'Category talk:'
WHEN 100 THEN 'Portal:' WHEN 101 THEN 'Portal talk:'
WHEN 118 THEN 'Draft:' WHEN 119 THEN 'Draft talk:'
WHEN 710 THEN 'TimedText:' WHEN 711 THEN 'TimedText talk:'
WHEN 828 THEN 'Module:' WHEN 829 THEN 'Module talk:'
WHEN 2300 THEN 'Gadget:' WHEN 2301 THEN 'Gadget talk:'
WHEN 2302 THEN 'Gadget definition:' WHEN 2303 THEN 'Gadget definition talk:'
ELSE CONCAT('{{ns:', page_namespace, '}}:')
END, page_title,']]') AS pagename
FROM page
JOIN revision_userindex ON rev_page = page_id
JOIN actor_revision ON actor_id = rev_actor
WHERE actor_name = 'Esoptr0n'; | {"resultsets": [{"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 3}], "runningtime": "0.06"} | enwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230608000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["actor_name"], "rowcount": 0}], "runningtime": "0.05"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230608000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["actor_name", "actor_user", "page_title", "comment_text", "rev_timestamp", "page_id"], "rowcount": 0}], "runningtime": "0.05"} | huwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230608000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"connection_id": 175982588} | huwiki_p |
fork of FoBe's 74072 | null | WITH article AS (
SELECT *
FROM page
JOIN categorylinks ON page_id = cl_from AND cl_to = "Kuvaiti_labdarúgók"
WHERE page_namespace = 0
AND page_is_redirect = 0
),
nocite AS (
SELECT DISTINCT(page_title), page_len
FROM article
JOIN templatelinks ON page_id = tl_from
JOIN linktarget ON lt_id = tl_target_id AND lt_title="CCitWeb" OR lt_title="CheckISBN" OR lt_title="ChuckISBN" OR lt_title="Cite_conference" OR lt_title="Cite_encyclopedia" OR lt_title="Cite_interview" OR lt_title="Cite_journal" OR lt_title="Cite_news" OR lt_title="Cite_peakbagger" OR lt_title="Cite_tweet" OR lt_title="Cite_video/doc" OR lt_title="Cite_web" OR lt_title="CitLib" OR lt_title="CitLib_Régi" OR lt_title="CitPer" OR lt_title="CitPer_Régi" OR lt_title="CitWeb" OR lt_title="CitWebRégi" OR lt_title="Cquote" OR lt_title="Hiv-web" OR lt_title="Hivatkozás/Epizód" OR lt_title="Hivatkozás/Könyv" OR lt_title="Idézet_ ordító" OR lt_title="Cite_act" OR lt_title="Xcite_web"
)
SELECT * FROM nocite | {"resultsets": [{"headers": ["Z\u00f6ld_sablon", "K\u00e9k_sablon"], "rowcount": 5079}], "runningtime": "4.77"} | huwiki |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230601000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["Tables_in_enwiki_p"], "rowcount": 107}], "runningtime": "0.11"} | huwiki_p |
Userspace pages of non-existent users (only redirects) | null | SELECT p.page_namespace, p.page_title, rd_namespace, rd_title FROM page p
join redirect on rd_from = p.page_id and rd_namespace not in (2, 3)
WHERE REPLACE(SUBSTRING_INDEX(p.page_title, '/', 1), '_', ' ') not in (select user_name from user)
AND p.page_namespace IN (2, 3)
AND p.page_is_redirect = 1
AND NOT IS_IPV4(SUBSTRING_INDEX(p.page_title, '/', 1)) -- Exclude IPv4
AND NOT IS_IPV6(SUBSTRING_INDEX(p.page_title, '/', 1)) -- Exclude IPv6
AND p.page_title NOT RLIKE '\.(css|cs|js|charset)$'
AND SUBSTRING_INDEX(p.page_title, '/', 1) NOT LIKE '%.%.%.xxx'
AND SUBSTRING_INDEX(p.page_title, '/', 1) NOT IN ('Unknown_user', 'Global_rename_script',
'Sec\"\'27\\u00226\\x3ETest_(WMF)') -- Exclude technical user pages
AND p.page_id NOT IN (
SELECT cl_from FROM categorylinks
WHERE cl_to IN ('User_soft_redirects', 'Wikipedia_doppelganger_accounts',
'Wikipedia_alternative_accounts', 'Retired_Wikipedians') -- Exclude these categories
)
AND p.page_id NOT IN (
SELECT tl_from FROM templatelinks WHERE tl_target_id IN (
select lt_id from linktarget where lt_namespace = 10
and lt_title in ("Sockpuppet", "Sockpuppeteer", "IPsock", "Checked_sockpuppet", "Sockpuppetry")
) -- Exclude pages tagged with sockpuppet template
)
-- and p.page_title like concat('%', rd_title)
and p.page_title = rd_title
ORDER BY p.page_latest DESC | {"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"], "rowcount": 100}], "runningtime": "0.15"} | enwiki_p |
Most frequent domains (frwiki) | This query compiles a list of 1 000 external links (from the main namespace of the French Wikipedia) grouped by website. | USE frwiki_p;
SELECT url, COUNT(*)
FROM (
SELECT SUBSTRING_INDEX(SUBSTRING(el_to, LOCATE('://', el_to) + 3), '/', 1) url
FROM externallinks
WHERE el_from IN (
SELECT page_id
FROM page
WHERE page_namespace = 0
)
) tmp_table
GROUP BY url
HAVING COUNT(*) > 10000
ORDER BY COUNT(*) DESC; | {"resultsets": [{"headers": ["ptrp_page_id", "ptrp_reviewed", "ptrp_deleted", "ptrp_created", "ptrp_tags_updated", "ptrp_reviewed_updated", "ptrp_last_reviewed_by"], "rowcount": 10}], "runningtime": "0.05"} | frwiki_p |
وصلات الصفحة | null | select * from pagelinks
where pl_from in (9224685)
and pl_namespace = 3
and pl_from_namespace = 2 | {"resultsets": [{"headers": ["lt_id", "lt_namespace", "lt_title"], "rowcount": 1}], "runningtime": "0.06"} | arwiki_p |
Taksonbar and authority control templates addition per day | null | SELECT
min(rev_id) as min_r,
count(distinct(rev_id)) as t,
floor(rev_timestamp/1000000) as d
FROM
revision_compat
WHERE
rev_user_text="Ipr1Bot"
AND rev_id>=21341662
GROUP BY d | {"resultsets": [{"headers": ["el_id"], "rowcount": 1}], "runningtime": "0.06"} | fiwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230609000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["el_id"], "rowcount": 0}], "runningtime": "0.05"} | huwiki_p |
Top Wikipedia Page by Bytecounts (This Month) | Verify each user's contribution here : https://quarry.wmflabs.org/query/54879 | select *
from
(select
rc_title,
sum( cast(rc_new_len as int) - cast(rc_old_len as int)) tdif
from recentchanges_userindex
where rc_timestamp >= 20230601000000 and rc_timestamp <= 20230610000000 and rc_bot = 0 and (rc_source = 'mw.new' or rc_source='mw.edit')
group by rc_title) a
where tdif > 30000
order by tdif desc | {"resultsets": [{"headers": ["el_id"], "rowcount": 0}], "runningtime": "0.04"} | idwiki |
Top Wikipedia User by Bytecounts (This month) | Verify each user's contribution here : https://quarry.wmflabs.org/query/54879 | select * /*sum(tdif)*/
from
(select
actor_name,
sum( cast(rc_new_len as int) - cast(rc_old_len as int)) tdif
from recentchanges_userindex
left join actor on rc_actor = actor_id
where rc_timestamp >= 20230601000000 and rc_timestamp <= 20230610000000 and rc_bot = 0 and (rc_source = 'mw.new' or rc_source='mw.edit')
group by actor_name) a
where tdif >= 30000
order by tdif desc | {"resultsets": [{"headers": ["el_id"], "rowcount": 0}], "runningtime": "0.05"} | idwiki |
بوت الصيانة - مقالات بحاجة لإضافة وسم غير مصنفة | null | use arwiki_p;
select p2.page_title from page p2
where p2.page_id not in (select cl_from
from categorylinks
inner join page p
on p.page_title = cl_to
and p.page_namespace = 14
where ((p.page_id not in (select cl_from from categorylinks where cl_to = 'تصنيفات_مخفية')) or cl_to like "%أشخاص_على_قيد_الحياة%")
)
and p2.page_namespace = 0
and p2.page_is_redirect = 0
and p2.page_id not in (select cl_from from categorylinks where cl_to like "%جميع_المقالات_غير_المصنفة%" and cl_from = p2.page_id)
and p2.page_id not in (select cl_from from categorylinks where cl_to like "%صفحات_توضيح%" and cl_from = p2.page_id); | {"resultsets": [{"headers": ["CONCAT(\"Category:\",page_title,\"\")"], "rowcount": 99}], "runningtime": "0.16"} | arwiki_p |
Pages with copvio template not listed on WP:C | null | SELECT DISTINCT page.page_title
FROM page
INNER JOIN templatelinks ON page_id = tl_from
WHERE page_namespace = 0
SELECT pl_title
FROM pagelinks
WHERE pl_from = 404
)
| {"resultsets": [{"headers": ["ID", "Namespace", "Title", "Date", "Summary", "Username"], "rowcount": 756}], "runningtime": "2906.18"} | huwiki_p |
Transclusions of missing templates | Code from https://github.com/fastily/fastilybot-toolforge/blob/master/scripts/report14.sql | select page_title, lt_title from linktarget
join templatelinks on tl_target_id = lt_id
join page on tl_from = page_id and page_namespace = 0
where lt_namespace = 10
and lt_title not in (select page_title from page where page_namespace = 10);
/*
select page_title, pl_title from pagelinks
join page on pl_from = page_id and page_namespace = 0
where pl_namespace = 10
and pl_title not in (select page_title from page where page_namespace = 10)
limit 100;
*/ | {"resultsets": [{"headers": ["linter_page", "linter_template", "pages_using_template"], "rowcount": 34}], "runningtime": "0.11"} | frwiki_p |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230608000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["linter_page", "linter_template", "pages_using_template"], "rowcount": 38}], "runningtime": "3.10"} | huwiki_p |
Broken redirects | null | SELECT page_title
FROM page, redirect
WHERE page_id = rd_from
AND rd_interwiki = ''
AND page_namespace = 0
AND NOT EXISTS ( SELECT 1
FROM page
WHERE page_title = rd_title
AND page_namespace = rd_namespace
) | {"resultsets": [{"headers": ["linter_template", "pages_using_template", "total_errors"], "rowcount": 50}], "runningtime": "0.12"} | enwiki_p |
Articles using template X | All articles in namespace 0 that are using a template X | SELECT *
FROM linktarget lt INNER JOIN templatelinks tl on tl.tl_target_id = lt.lt_id
INNER JOIN page pg on pg.page_id = tl.tl_from
WHERE (lt.lt_namespace = 10 AND lt.lt_title = 'Infobox Biographie2' AND pg.page_namespace = 0) ; | {"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 36}], "runningtime": "4.30"} | frwiki |
Misnomers of (dab)pages | null | select page_title from page
where page_title like "%\_(disambiguation)" and page_namespace = 0 and page_is_redirect = 0
and page_id not in (select cl_from from categorylinks where cl_to in ("All_disambiguation_pages", "All_set_index_articles")); | {"connection_id": 176550722} | enwiki_p |
Broken redirects | null | SELECT CONCAT("[[",page_title,"]]")
FROM page, redirect
WHERE page_id = rd_from
AND rd_interwiki = ''
AND page_namespace = 0
AND NOT EXISTS ( SELECT 1
FROM page
WHERE page_title = rd_title
AND page_namespace = rd_namespace
) | {"resultsets": [{"headers": ["reason", "counter"], "rowcount": 50}], "runningtime": "1.46"} | huwiki |
Liens INSEE uniques et nombres d'occurences (frwiki) | null | USE frwiki_p;
SELECT el_to, COUNT(*) AS link_count
FROM page
JOIN externallinks
ON page_id = el_from
WHERE page_namespace = 0
AND (el_to LIKE 'http://insee.fr/%' OR el_to LIKE 'http://www.insee.fr/%' OR el_to LIKE 'https://insee.fr/%' OR el_to LIKE 'https://www.insee.fr/%')
GROUP BY el_to
ORDER BY link_count DESC; | {"resultsets": [{"headers": ["comment_text"], "rowcount": 172}], "runningtime": "0.25"} | frwiki |
Admin gender on English Wikipedia | Gender of admins and crats on enwiki. | SELECT up_value Gender, COUNT(DISTINCT ug_user) admins FROM enwiki_p.user_groups JOIN enwiki_p.user_properties ON ug_user=up_user
WHERE (ug_group='sysop' OR ug_group='bureaucrat') AND (up_property='gender') GROUP BY up_value
# Copied from https://quarry.wmflabs.org/query/1888 by ICebear Sweden, with thanks. | {"resultsets": [{"headers": ["page_title"], "rowcount": 1474}], "runningtime": "1.30"} | enwiki_p |
Daily article deletions | null | SELECT
DATE( log_timestamp ) AS DATE,
COUNT( log_id ) AS deletions
FROM logging
WHERE log_action='delete'
AND log_namespace =0
GROUP BY DATE( log_timestamp )
ORDER BY DATE DESC | {"resultsets": [{"headers": ["page_title", "page_id", "talk_id"], "rowcount": 2414}], "runningtime": "188.78"} | frwiki_p |
Articles with pending changes all having a given tag | null | SELECT
CONCAT("[[",page1.page_title,"]]") AS "Cím",
CONCAT('[https://hu.wikipedia.org/w/index.php?title=',page1.page_title,'&oldid=',flaggedpage_pending.fpp_rev_id,'&diff=',page1.page_latest,' ellenőriz]') AS 'Ellenőriz'
FROM page AS page1
INNER JOIN flaggedpage_pending ON flaggedpage_pending.fpp_page_id = page1.page_id
WHERE page_namespace = 0
AND (SELECT GROUP_CONCAT(rev_id) FROM revision
INNER JOIN page AS page2 ON revision.rev_page = page2.page_id
WHERE page1.page_id = page2.page_id AND rev_id > fpp_rev_id
GROUP BY page2.page_id)
=
(SELECT GROUP_CONCAT(rev_id) FROM revision
INNER JOIN page AS page2 ON revision.rev_page = page2.page_id
INNER JOIN change_tag ON change_tag.ct_rev_id = revision.rev_id
WHERE page1.page_id = page2.page_id AND rev_id > fpp_rev_id AND ct_tag_id = 202 # tag no.
GROUP BY page2.page_id) | {"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model", "page_lang"], "rowcount": 15}], "runningtime": "0.73"} | huwiki |
Top Wikipedia User by Bytecounts (This month) | Verify each user's contribution here : https://quarry.wmflabs.org/query/54879 | select * /*sum(tdif)*/
from
(select
actor_name,
sum( cast(rc_new_len as int) - cast(rc_old_len as int)) tdif
from recentchanges_userindex
left join actor on rc_actor = actor_id
where rc_timestamp >= 20230601000000 and rc_timestamp <= 20230612000000 and rc_bot = 0 and (rc_source = 'mw.new' or rc_source='mw.edit')
group by actor_name) a
where tdif >= 30000
order by tdif desc | {"resultsets": [{"headers": ["actor_id", "actor_user", "actor_name"], "rowcount": 10}], "runningtime": "0.07"} | idwiki |
Top Wikipedia Page by Bytecounts (This Month) | Verify each user's contribution here : https://quarry.wmflabs.org/query/54879 | select *
from
(select
rc_title,
sum( cast(rc_new_len as int) - cast(rc_old_len as int)) tdif
from recentchanges_userindex
where rc_timestamp >= 20230601000000 and rc_timestamp <= 20230701000000 and rc_bot = 0 and (rc_source = 'mw.new' or rc_source='mw.edit')
group by rc_title) a
where tdif > 30000
order by tdif desc | {"resultsets": [{"headers": ["actor_name", "page_title", "COUNT(*)"], "rowcount": 50}], "runningtime": "2.89"} | idwiki |
Reviewer stats by time interval (huwiki) | FlaggedRevs reviewer (patroller) stats / ranking based on actions in the last 30 days. | use huwiki_p;
SELECT
CONCAT(ROW_NUMBER() OVER(ORDER BY count(*) DESC),'.') AS '#',
user_name as 'Szerkesztő',
count(*) as 'Ellenőrzések száma az időszakban'
FROM
logging
JOIN actor ON log_actor = actor_id
JOIN user ON actor_user = user_id
WHERE
log_type = 'review'
AND log_action IN ('approve', 'approve2', 'approve-i', 'approve2-i')
AND log_timestamp >= '20230610000000' # előző hónap eleje
AND log_timestamp < '20230701000000' # mostani hónap eleje
GROUP BY user_name
ORDER BY count(*) DESC
; | {"resultsets": [{"headers": ["actor_name", "page_title", "COUNT(*)"], "rowcount": 300}], "runningtime": "3.19"} | huwiki_p |
Short descriptions that contain words they probably shouldn't | null | SELECT CONCAT('https://en.wikipedia.org/wiki/', p.page_title) AS 'Page', pp.pp_value AS 'Short description'
FROM page_props pp
INNER JOIN page p ON pp.pp_page = p.page_id AND p.page_namespace = 0
WHERE pp_propname = 'wikibase-shortdesc'
AND (
pp.pp_value LIKE '%overview%' OR
pp.pp_value LIKE '%aspect%'
-- pp.pp_value LIKE '%list%'
)
LIMIT 1000 | {"resultsets": [{"headers": ["CONCAT(\"Category talk:\",page_title,\"\")"], "rowcount": 138}], "runningtime": "0.44"} | enwiki_p |
Hewiki fair use unused pictures 1 | null | select concat('# [[:קובץ:', replace(page_title, "_", " "), ']]') as Suspicious_file_title from page as p1 join image on exists
(select * from categorylinks as cl1 where cl_from = page_id and (cl_to = "ויקיפדיה_-_תמונות_שימוש_הוגן" or exists (select * from page as
p2 where p2.page_namespace = 14 and p2.page_title = cl1.cl_to and exists (select * from categorylinks as cl2 where cl2.cl_from = p2.page_id
and (cl2.cl_to = "ויקיפדיה_-_תמונות_שימוש_הוגן" or exists (select * from page as p3 where p3.page_namespace = 14 and p3.page_title =
cl2.cl_to and exists (select * from categorylinks as cl3 where cl3.cl_from = p3.page_id and (cl3.cl_to =
"ויקיפדיה_-_תמונות_שימוש_הוגן")))))))) and page_namespace = 6 and not exists (select * from imagelinks where il_to = page_title and
il_from_namespace in (0, 1, 2, 3, 4, 5, 11, 100, 118)) and img_name = page_title and datediff(now(), img_timestamp) > 7 and not
replace(page_title, "_", " ") = "Amud Anan Search 0.png" and not exists (select * from pagelinks where pl_from = 1282376 and page_title
= pl_title)
| {"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 35}], "runningtime": "0.40"} | hewiki_p |
Unreferenced BLPs (huwiki fork) | BLPs of huwiki, which do not utilize any of the conventional citation templates, an external link, ISBN numbers, or a section titled "Források" (common name on huwiki for a reflist). | WITH article AS (
SELECT *
FROM page
JOIN categorylinks ON page_id = cl_from AND cl_to = "Élő_személyek"
WHERE page_namespace = 0
AND page_is_redirect = 0
),
no_ext AS (
SELECT DISTINCT(page_title), page_len
FROM article
LEFT JOIN externallinks ON page_id = el_from
WHERE el_id IS NULL
),
no_cite AS (
SELECT DISTINCT(page_title), page_len
FROM article
JOIN templatelinks ON page_id = tl_from
JOIN linktarget ON lt_id = tl_target_id AND lt_title="CCitWeb" OR lt_title="CheckISBN" OR lt_title="ChuckISBN" OR lt_title="Cite_conference" OR lt_title="Cite_encyclopedia" OR lt_title="Cite_interview" OR lt_title="Cite_journal" OR lt_title="Cite_news" OR lt_title="Cite_peakbagger" OR lt_title="Cite_tweet" OR lt_title="Cite_video/doc" OR lt_title="Cite_web" OR lt_title="CitLib" OR lt_title="CitLib_Régi" OR lt_title="CitPer" OR lt_title="CitPer_Régi" OR lt_title="CitWeb" OR lt_title="CitWebRégi" OR lt_title="Cquote" OR lt_title="Hiv-web" OR lt_title="Hivatkozás/Epizód" OR lt_title="Hivatkozás/Könyv" OR lt_title="Idézet_ ordító" OR lt_title="Cite_act" OR lt_title="Xcite_web"
),
reflist AS (
SELECT DISTINCT(page_title), page_len
FROM article
JOIN templatelinks ON page_id = tl_from
JOIN linktarget ON lt_id = tl_target_id AND lt_title = "Források"
),
isbn AS (
SELECT DISTINCT(page_title), page_len
FROM article
JOIN templatelinks ON page_id = tl_from
JOIN linktarget ON lt_id = tl_target_id AND lt_title = "ISBN"
)
SELECT * FROM no_ext
EXCEPT
SELECT * FROM no_cite
EXCEPT
SELECT * FROM reflist
EXCEPT
SELECT * FROM isbn | {"resultsets": [{"headers": ["wbit_id", "wbit_item_id", "wbit_term_in_lang_id"], "rowcount": 100}], "runningtime": "0.13"} | huwiki_p |
mlwiki articles without any statements in Wikidata | null | use wikidatawiki_p;
SELECT *
FROM wb_items_per_site,page_props,page
WHERE ips_site_id IN ('mlwiki')
AND page_namespace=0 AND ips_item_id=substr(page_title,2)*1 AND page_id=pp_page AND pp_propname='wb-claims' AND pp_sortkey=0 | {"resultsets": [{"headers": ["wbit_item_id", "description", "wbxl_language"], "rowcount": 100}], "runningtime": "0.15"} | wikidatawiki_p |
Novem Linguae's page curation count | null | SELECT *
FROM logging
JOIN actor ON log_actor = actor_id
WHERE log_action = 'reviewed'
AND log_type = 'pagetriage-curation'
AND actor_name = 'Novem Linguae' | {"resultsets": [{"headers": ["page_title", "ct_params", "rev_timestamp", "ct_log_id", "ct_rev_id"], "rowcount": 10}], "runningtime": "0.10"} | enwiki |
ويكيبيديا:طلبات استبدال الصور | null | # Note: The page ID of the image is 9147981.
select page.page_title as "prt_title",page.page_namespace as "prt_namespace"
from imagelinks
inner join page on page.page_id = imagelinks.il_from
where il_to in (
select page_title from page where page_id in (9147981) and page_namespace in (6)
)
and il_from_namespace in (0,14,10)
| {"resultsets": [{"headers": ["page_title", "log_timestamp", "page_id", "log_comment"], "rowcount": 80}], "runningtime": "0.14"} | arwiki_p |