title
stringlengths
1
212
description
stringlengths
1
4.39k
query
stringlengths
1
65.5k
extra_info
stringlengths
18
31.6k
wikidb
stringlengths
4
26
Empty categories on plwiki
null
SELECT distinct CONCAT('# [[:Kategoria:',page_title,']]') AS page_title, str_to_date(rev_timestamp, '%Y%m%d%H%i%s') AS rev_timestamp FROM categorylinks#, page, revision RIGHT JOIN page ON cl_to = page_title JOIN revision ON rev_page = page_id WHERE page_namespace = 14 #AND page_is_redirect = 1 AND rev_parent_id = 0 AND...
{"resultsets": [{"rowcount": 50, "headers": ["actor_name", "freq"]}], "runningtime": "0.16"}
plwiki_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": [{"rowcount": 44, "headers": ["disambiguation", "redirect", "target", "fragment"]}], "runningtime": "20.34"}
enwiki_p
Cross-namespace redirects
[[WP:R2]] candidates.
SELECT p.page_id FROM page p JOIN redirect r ON r.rd_from = p.page_id WHERE p.page_namespace = 0 AND r.rd_namespace NOT IN (0, #Article 14, # Category 10, # Template 4, # Wikipedia 5, # Wikipedia talk - see Wikip...
{"runningtime": "242.53", "resultsets": [{"rowcount": 100, "headers": ["count", "page_title"]}]}
enwiki_p
Commons deletion requests which haven't been transcluded
These are normally to be added to a daily log page. Note that the list also contains a few deletion request archives and other pages which are not to be added there.
SELECT CONCAT('{{Commons:', p.page_title, '}}') FROM page p LEFT JOIN (templatelinks t1 INNER JOIN page p2 ON p2.page_id = t1.tl_from AND p2.page_title LIKE 'Deletion_requests/%') ON p.page_title = t1.tl_title AND t1.tl_from_namespace = 4 AND t1.tl_namespace = 4 LEFT JOIN templatelinks t2 ON p.page_id = t2.tl_from A...
{"resultsets": [{"rowcount": 1, "headers": ["sender", "thanks"]}], "runningtime": "0.71"}
commonswiki_p
New editors' edits that look good (by heuristics)
null
SELECT rc_timestamp,rc_this_oldid AS oldid, rc_new_len-rc_old_len AS diff_len, actor_name, rc_title, comment_text FROM recentchanges_userindex JOIN actor ON rc_actor = actor_id JOIN comment ON rc_comment_id = comment_id WHERE rc_type <= 1 AND actor_user IN (SELECT user_id FROM user where user_id > (select user_id f...
{"resultsets": [{"headers": ["Username", "cnt"], "rowcount": 128}], "runningtime": "219.93"}
jawiki_p
Thanks on jawiki (monthly)
see http://quarry.wmflabs.org/query/216
SELECT LEFT(log_timestamp, 6) as month, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY month;
{"resultsets": [{"headers": ["Username", "cnt"], "rowcount": 55}], "runningtime": "215.91"}
jawiki_p
Edit comments containing a given word on plwiki
null
SELECT CONCAT("* [[Specjalna:Diff/",rev_id,"]]") AS rev_id, comment_text FROM revision, comment WHERE comment_text LIKE '%Wikipediabezbarier%' AND rev_comment_id = comment_id
{"connection_id": 10913699}
plwiki_p
Articles with NULL author on plwiki
null
SELECT * /*CONCAT('# [[', page_title ,']]') AS page_title, rev_timestamp, rev_user_text*/ FROM page, revision WHERE rev_page = page_id AND page_is_new = 1 AND page_namespace = 0 AND page_is_redirect = 0 AND rev_actor = 0 ORDER BY rev_timestamp
{"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", "tl_from"], "rowcount": 50}], "runningtime": "0.14"}
plwiki_p
Unexisting categories on plwiki
null
SELECT CONCAT('# [[:Kategoria:',cl_to,'|Kategoria:',cl_to,']]') AS cl_to, COUNT(*) AS count_cl_to FROM page, categorylinks WHERE page_id = cl_from AND page_namespace = 0 AND cl_to NOT LIKE 'Polacy_odznaczeni_francuskim_Krzyżem_Wojennym' AND cl_to NOT LIKE 'Majorzy_II_Rzeczypospolitej' AND cl_to NOT LIKE 'Szemborowo' AN...
{"resultsets": [{"headers": ["page_title", "page_is_redirect"], "rowcount": 1989032}], "runningtime": "3315.13"}
plwiki_p
Orphaned files tagged as missing license at Meta-Wiki
Trying to get all orphaned files tagged as no license in the category at Meta-Wiki.
SELECT page_title FROM page INNER JOIN categorylinks ON cl_from = page_id LEFT JOIN imagelinks ON page_title = il_to WHERE cl_to = 'Images_with_unknown_license' AND page_namespace = 6 AND il_to IS NULL;
{"resultsets": [{"headers": ["actor_name", "rc_this_oldid", "comment_text"], "rowcount": 214}], "runningtime": "28.19"}
metawiki_p
Sandboxes of anonymous users ? on plwiki
null
SELECT CONCAT("# [[User:",page_title,"]]") AS page_title, page_len, rev_timestamp FROM page, revision WHERE page_latest = rev_id AND page_title RLIKE '[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}\/.*' AND page_title NOT LIKE '%.css' AND page_title NOT LIKE '%.js' #AND page_title NOT LIKE '%/brudnopis%' AND page_na...
{"resultsets": [{"headers": ["page_title"], "rowcount": 430}], "runningtime": "0.80"}
plwiki_p
Icelandic cross namespace redirects
null
select page_namespace, page_title, rd_namespace, rd_title, page_id from page inner join redirect on rd_from = page_id and rd_namespace =! page_namespace and rd_interwiki = '' limit 300
{"resultsets": [{"headers": ["page_title"], "rowcount": 614}], "runningtime": "17.32"}
iswiki_p
Featured DYK Contributions
Yearwise contributions of users for DYI featured on tewiki
SELECT LEFT(rev_timestamp,4) AS iyear, actor_name, COUNT(*) As Edits FROM actor LEFT JOIN revision ON actor_id=rev_actor LEFT JOIN page ON page_id = rev_page WHERE (((page_namespace = 10 OR page_namespace = 11) AND page_title = 'మీకు_తెలుసా?1') OR ((page_namespace = 4 OR page_namespace = 5) ...
{"resultsets": [{"headers": ["el_from", "page_title", "el_to"], "rowcount": 108887}], "runningtime": "134.76"}
tewiki_p
Featured article blurb contributors
year, user wise featured article blurb contributors on tewiki
SELECT SUBSTRING(page_title,LENGTH('ఈ_వారపు_వ్యాసం/')+1,4) AS iyear, actor_name, COUNT(*) As Edits FROM actor LEFT JOIN revision ON rev_actor = actor_id LEFT JOIN page ON page_id = rev_page where (page_namespace = 4 OR page_namespace = 5) AND page_title LIKE 'ఈ_వారపు_వ్యాసం/%' AND actor_user != 0 ...
{"connection_id": 9639453}
tewiki_p
Current deletion discussions on plwiki (2)
null
SELECT CONCAT("Wikipedia:" , tl_title) as tl_title FROM templatelinks, page p1, page p2 WHERE tl_title = p2.page_title AND tl_title LIKE 'Poczekalnia/%' AND tl_title NOT LIKE 'Poczekalnia/Załatwione%' AND tl_title NOT LIKE 'Poczekalnia/Zgłoszenia%' AND tl_title NOT LIKE 'Poczekalnia/preload%' AND tl_title NOT LIKE 'Poc...
{"connection_id": 35075012}
plwiki_p
Most used template redirects on plwiki
null
SELECT DISTINCT CONCAT("{{S|",page_title,"}}") AS template, COUNT(DISTINCT tl_from) AS counting FROM page JOIN templatelinks ON page_title = tl_title AND tl_namespace = 10 AND tl_from_namespace = 0 WHERE page_namespace = 10 AND page_is_redirect = 1 AND page_title NOT LIKE 'Państwo_dane%' GROUP BY page_title ORDER BY c...
{"resultsets": [{"headers": ["page_title", "cl_to"], "rowcount": 24}], "runningtime": "12.33"}
plwiki_p
Hewiki unexisting templates
null
select page_namespace, page_title, tl_title from page inner join templatelinks where page_namespace in (0, 4, 6, 8, 10, 12, 14, 100) and page_id = tl_from and tl_namespace != 8 and not ((page_namespace = 100 and (tl_namespace <> 10 or tl_title like "הידעת_מדינות_%")) or (page_namespace = 8 and page_title like "%.js") o...
{"resultsets": [{"headers": ["concat('Module:', log_title)", "DATE_FORMAT(log_timestamp, '%Y-%m-%d %H:%M:%S')"], "rowcount": 10}], "runningtime": "3.10"}
hewiki_p
Orphaned fair use images (en)
Returns the list of fair use images that are not presently used in any articles
SELECT CONCAT('*{{lf|', REPLACE(REPLACE(p.page_title, '"', '**DOUBLEQUOTE**'), '_', ' '), '}}') FROM page p INNER JOIN categorylinks c1 ON p.page_id = c1.cl_from LEFT JOIN imagelinks i ON p.page_title = i.il_to AND (i.il_from_namespace = 0) LEFT JOIN categorylinks c2 ON p.page_id = c2.cl_from AND c2.cl_to = "All_orp...
{"resultsets": [{"headers": ["ng\u00e0y", "t\u1ed5ng_s\u1eeda_\u0111\u1ed5i_t\u1eeb_khi_m\u1edbi_tham_gia"], "rowcount": 2428}], "runningtime": "188.35"}
enwiki_p
Wikidata descriptions consisting only of one character (all languages)
See also https://www.wikidata.org/wiki/Special:AbuseFilter/41
SELECT CONCAT('https://www.wikidata.org/wiki/Q', wbit_item_id, '?action=history') AS item, wbxl_language, wbx_text, page_latest 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...
{"resultsets": [{"headers": ["ar_id", "ar_namespace", "ar_title", "ar_text", "ar_comment_id", "ar_actor", "ar_timestamp", "ar_minor_edit", "ar_flags", "ar_rev_id", "ar_deleted", "ar_len", "ar_page_id", "ar_parent_id", "ar_sha1"], "rowcount": 0}], "runningtime": "0.07"}
wikidatawiki_p
Top 25 edited gu
(copied from en) :)
SELECT rc_title, COUNT(*) AS num_edits FROM guwiki_p.recentchanges WHERE rc_namespace = 0 GROUP BY rc_title ORDER BY num_edits DESC LIMIT 25;
{"resultsets": [{"headers": ["log_id", "log_timestamp", "user", "log_title", "log_params", "summary"], "rowcount": 100}], "runningtime": "13.34"}
guwiki_p
Files in need of a Creator template
null
SELECT concat("File:",file.page_title) as filename , concat("Creator:",creator.page_title) as creatorname FROM page as file JOIN categorylinks AS c1 ON c1.cl_from = file.page_id AND c1.cl_to = 'Photographs_of_paintings_by_User:Sailko' JOIN categorylinks AS c2 ON c2.cl_from = file.page_id AND c2.cl_to = 'Paintings_witho...
{"resultsets": [{"headers": ["page_title"], "rowcount": 97}], "runningtime": "0.32"}
commonswiki_p
Ανύπαρκτα πρότυπα
Ανύπαρκτα πρότυπα
SELECT P.page_namespace, P.page_title, tl_namespace, tl_title FROM templatelinks JOIN page AS P ON P.page_id = tl_from LEFT JOIN page AS L on L.page_namespace = tl_namespace AND L.page_title = tl_title WHERE L.page_namespace IS NULL -- use elwiki_p; -- select tl_title as 'protypo', page_...
{"resultsets": [{"headers": ["cl_to", "count_cl_to"], "rowcount": 1}], "runningtime": "54.01"}
elwiki
Small iswiki articles not marked as stubs
null
select page_title, page_len from page left outer join categorylinks on cl_from = page_id and cl_to = "Aðgreiningarsíður" left outer join templatelinks on tl_from = page_id and tl_target_id = 89 where cl_from is null and tl_from is null and page_namespace = 0 and page_len < 500 and page_is_redirect = 0 order by page_le...
{"resultsets": [{"headers": ["tl_namespace", "tl_title", "count", "ns"], "rowcount": 101}], "runningtime": "89.76"}
iswiki_p
Most active users by edits on plwiki in last 12 months
null
SELECT CONCAT("#") AS number, actor_user, CONCAT("[[user:",actor_name,"|",actor_name,"]]") AS rev_user_text, COUNT(actor_id) AS recent_user_editcount/*, user_editcount*/ FROM revision JOIN actor ON rev_actor=actor_id JOIN page ON rev_page=page_id WHERE page_namespace = 0 AND actor_user IS NOT NULL AND rev_timestamp B...
{"resultsets": [{"headers": ["id", "type", "language", "text"], "rowcount": 1}], "runningtime": "0.05"}
plwiki_p
Most active users by edits on plwiki in last 6 months
null
SELECT CONCAT("#") AS number, actor_user, CONCAT("[[user:",actor_name,"|",actor_name,"]]") AS rev_user_text, COUNT(actor_id) AS recent_user_editcount/*, user_editcount*/ FROM revision JOIN actor ON rev_actor=actor_id JOIN page ON rev_page=page_id WHERE page_namespace = 0 AND actor_user IS NOT NULL AND rev_timestamp B...
{"resultsets": [{"headers": ["id", "type", "language", "text"], "rowcount": 0}], "runningtime": "0.05"}
plwiki_p
Most active users by bytes on plwiki
null
SELECT CONCAT("#") as number, actor_user AS user_id, CONCAT("[[user:",actor_name,"|",actor_name,"]]") AS user_name, SUM(CAST(rev.rev_len as signed)-CAST(parent.rev_len as signed)) AS byte_count FROM actor JOIN revision rev ON actor_id = rev.rev_actor JOIN revision parent ON rev.rev_parent_id = parent.rev_id JOIN page O...
{"resultsets": [{"headers": ["id", "type", "language", "text"], "rowcount": 3}], "runningtime": "1.35"}
plwiki_p
Most active users by articles on plwiki
null
SELECT CONCAT("#") AS number, actor_user AS user_id, CONCAT("[[user:",actor_name,"|",actor_name,"]]") AS user_name, #CONCAT("{{Formatnum:",COUNT(rev_id),"}}") AS user_editcount COUNT(rev_id) AS user_editcount FROM actor INNER JOIN revision ON revision.rev_actor = actor.actor_id JOIN page ON page.page_id = revision.rev_...
{"resultsets": [{"headers": ["CONCAT(\"File:\", p0.page_title)", "CONCAT(\"Creator:\", lt_title)"], "rowcount": 64277}], "runningtime": "64.85"}
plwiki_p
Users with most edits (lvwiki)
null
USE lvwiki_p; SELECT distinct u.user_name, u.user_editcount FROM user u inner join user_groups ug on ug.ug_user=u.user_id where ug.ug_group<>'bot' ORDER BY u.user_editcount desc LIMIT 300;
{"resultsets": [{"headers": ["gt_lat", "gt_lon", "gt_primary", "gt_page_id", "gt_name", "ns", "title", "gt_country", "gt_region"], "rowcount": 500}], "runningtime": "0.55"}
lvwiki_p
it.wiki tables
null
SHOW TABLES; DESCRIBE templatelinks;
{"resultsets": [{"headers": ["page_title"], "rowcount": 0}], "runningtime": "1.16"}
itwiki_p
pl wikisource Pages_Without_Scans
null
SELECT page_title AS title, page_len AS len, pl_title AS author, DATE_FORMAT(MAX(rev_timestamp),'%Y-%m-%d') AS ledit_date, DATE_FORMAT(MIN(rev_timestamp),'%Y-%m-%d') AS create_date FROM revision, page LEFT JOIN (SELECT DISTINCT pl_from, pl_title FROM pagelinks WHERE pl_namespace = 104) AS PGL on page_id = p...
{"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": ...
plwikisource_p
Redirects in cswiki connected with Wikidata
null
SELECT page_namespace, page_title, page_latest, pp_value AS item, COUNT(ll_lang) AS links FROM page JOIN page_props ON pp_page = page_id LEFT JOIN langlinks ON ll_from = page_id WHERE page_is_redirect = 1 AND pp_propname = 'wikibase_item' GROUP BY page_id ORDER BY page_title, page_namespace;
{"resultsets": [{"headers": ["pl_from", "pl_namespace", "pl_title", "pl_from_namespace"], "rowcount": 10}], "runningtime": "0.06"}
cswiki_p
Voci non presenti su it.wiki (2)
null
SELECT CONCAT('# ', COUNT(*),' - [[', page_title, ']]') FROM langlinks JOIN page ON ll_from = page_id WHERE page_namespace = 0 AND NOT EXISTS ( SELECT * FROM langlinks AS t WHERE t.ll_lang='it' AND t.ll_from = langlinks.ll_from) GROUP BY ll_from HAVING COUNT(*) > 24 AND COUNT(*) < 30 ORD...
{"resultsets": [{"headers": ["date", "count(*)", "avg(page_len)", "sum(page_len)"], "rowcount": 92}], "runningtime": "0.43"}
enwiki_p
Wikidata test
null
SHOW TABLES; #DESCRIBE langlinks;
{"resultsets": [{"headers": ["rev_actor", "rev_page", "count(r.rev_id)"], "rowcount": 218917}], "runningtime": "185.66"}
wikidatawiki_p
Voci non presenti su it.wiki
Elenco di voci presenti in almeno 30 wiki non in lingua italiana che potrebbero potenzialmente essere tradotte in italiano su it.wikipedia.org
SELECT CONCAT('# ', COUNT(*),' - [[', page_title, ']]') FROM langlinks JOIN page ON ll_from = page_id WHERE page_namespace = 0 AND NOT EXISTS ( SELECT * FROM langlinks AS t WHERE t.ll_lang='it' AND t.ll_from = langlinks.ll_from) GROUP BY ll_from HAVING COUNT(*) BETWEEN 30 AND 39 ORDER BY...
{"resultsets": [{"headers": ["user_name", "user_registration", "time", "user_editcount"], "rowcount": 58}], "runningtime": "14.61"}
enwiki_p
(iswiki) Categorylinks on redirected cats
null
select page_title, cat_pages from page join categorylinks on page_title = cl_to join category on cat_title = page_title where page_is_redirect = 1 and page_namespace = 14 limit 2000
{"resultsets": [{"headers": ["AllEdits", "AllReverts", "% reverts all", "EXCEdits", "EXCReverts", "% reverts EXC", "nonEXCEdits", "nonEXCReverts", "% reverts non-EXC", "AutoEdits", "AutoReverts", "% reverts auto", "nonAutoEdits", "nonAutoReverts", "% reverts non-auto", "AutoAndNonEXCEdits", "AutoAndNonEXCReverts", "% r...
iswiki_p
it.wiki articles not having {{Collegamenti esterni}}
null
SELECT page_title FROM page WHERE page_is_redirect = 0 AND page_namespace = 0 AND NOT EXISTS ( SELECT * FROM templatelinks JOIN linktarget ON tl_target_id = lt_id WHERE page_id = tl_from AND lt_namespace = 10 AND lt_title = 'Collegamenti_esterni' )
{"connection_id": 162756107}
itwiki_p
(iswiki) Redirects to deleted pages
null
select a.page_namespace, a.page_title, rd_title, rd_namespace, rd_from from redirect join page a on a.page_id = rd_from join logging on rd_title = log_title AND log_type = 'delete' left outer join page b on b.page_title = rd_title where b.page_title is null group by rd_from limit 500
{"resultsets": [{"headers": ["page_title", "max(page_touched)"], "rowcount": 1}], "runningtime": "2.17"}
iswiki_p
Test
Test
SELECT * FROM page_props WHERE pp_page = 8318930 ;
{"resultsets": [{"headers": ["Page title", "No. of errors"], "rowcount": 1000}], "runningtime": "40.55"}
dewiki_p
Largest redirects in cswiki
null
SELECT page_len, page_namespace, page_title FROM page WHERE page_is_redirect = 1 AND page_namespace NOT IN (2,3) ORDER BY page_len DESC, page_namespace, page_title LIMIT 100;
{"resultsets": [{"headers": ["qid", "type", "lang", "text"], "rowcount": 1012}], "runningtime": "1514.23"}
cswiki_p
Deleted Wikidata entities that are still linked
Taken from #1279 See https://www.wikidata.org/wiki/Wikidata:Database_reports/Deleted_Wikidata_entities_that_are_still_linked
SELECT pl_title#, COUNT(*) FROM pagelinks LEFT JOIN page ON pl_title = page_title AND pl_namespace = page_namespace WHERE pl_from_namespace IN (0, 120, 146) AND pl_namespace IN (0, 120, 146) AND page_id IS NULL #GROUP BY pl_title #ORDER BY COUNT(*) DESC, pl_namespace, pl_title;
{"resultsets": [{"headers": ["qid", "type", "lang", "text"], "rowcount": 1210}], "runningtime": "488.47"}
wikidatawiki_p
Redirected old-named infoboxes to be deleted in cswiki
Lists infoboxes in cswiki that have been redirected and have no use.
SELECT CONCAT("Šablona:",page_title), CONCAT("Šablona:",rd_title), CONCAT("https://cs.wikipedia.org/wiki/?redirect=no&curid=",page_id,"&action=delete") AS link FROM page JOIN redirect ON rd_from = page_id WHERE page_title LIKE "Infobox%" AND page_namespace = 10 AND page_is_redirect = 1 AND NOT EXISTS ( SELECT 1 FROM...
{"resultsets": [{"headers": ["User page", "User edit count", "Page last edited", "Page length", "Is new?"], "rowcount": 703}], "runningtime": "5.10"}
cswiki_p
Old-named infoboxes by number of transclusions in cswiki
In cswiki, all infoboxes should be consistent as well as their title, since 2013. The goal is to have this query empty.
SELECT lt_title, COUNT(*) AS backlinks, SUM(IF(tl_from_namespace = 0, 1, 0)) AS from_main, IF(page_title IS NULL, 0, 1) AS page_exists, IF(page_title IS NULL, 0, page_is_redirect) AS page_is_redirect FROM linktarget JOIN templatelinks ON tl_target_id = lt_id LEFT JOIN page ON page_title = lt_title AND page_namespace =...
{"resultsets": [{"headers": ["REGEXP_SUBSTR(el_to, 'Q[0-9]*')", "P18", "CONCAT(\"\\\"\", REPLACE(page_title, \"_\", \" \"), \"\\\"\")"], "rowcount": 621}], "runningtime": "0.97"}
cswiki_p
LPL Q4 FY 2013-14
null
#-----LEARNING PATTERN EDITS #edits to the LEARNING PATTERNS by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.pa...
{"resultsets": [{"headers": ["year", "edits_community"], "rowcount": 1}, {"headers": ["year", "edits_WMF"], "rowcount": 1}, {"headers": ["year", "editors_Community"], "rowcount": 1}, {"headers": ["year", "editors_WMF"], "rowcount": 1}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"head...
null
LPL Q1 FY 2014-15
null
#-----LEARNING PATTERN EDITS #edits to the LEARNING PATTERNS by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.pa...
{"resultsets": [{"headers": ["year", "edits_community"], "rowcount": 1}, {"headers": ["year", "edits_WMF"], "rowcount": 1}, {"headers": ["year", "editors_Community"], "rowcount": 1}, {"headers": ["year", "editors_WMF"], "rowcount": 1}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"head...
null
LPL Q2 FY 2014-15
null
#-----LEARNING PATTERN EDITS #edits to the LEARNING PATTERNS by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.pa...
{"resultsets": [{"headers": ["year", "edits_community"], "rowcount": 1}, {"headers": ["year", "edits_WMF"], "rowcount": 1}, {"headers": ["year", "editors_Community"], "rowcount": 1}, {"headers": ["year", "editors_WMF"], "rowcount": 1}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"head...
null
LPL Q4 FY 2014-15
null
#-----LEARNING PATTERN EDITS #edits to the LEARNING PATTERNS by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.pa...
{"resultsets": [{"headers": ["year", "edits_community"], "rowcount": 1}, {"headers": ["year", "edits_WMF"], "rowcount": 1}, {"headers": ["year", "editors_Community"], "rowcount": 1}, {"headers": ["year", "editors_WMF"], "rowcount": 1}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"head...
null
LPL Q3 FY 2014-15
null
#-----LEARNING PATTERN EDITS #edits to the LEARNING PATTERNS by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.pa...
{"resultsets": [{"headers": ["year", "edits_community"], "rowcount": 1}, {"headers": ["year", "edits_WMF"], "rowcount": 1}, {"headers": ["year", "editors_Community"], "rowcount": 1}, {"headers": ["year", "editors_WMF"], "rowcount": 1}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"head...
null
LPL Endorsements
null
#-----LEARNING PATTERNS ENDORSEMENTS #Endorsements by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, EXTRACT(Month from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `month`, COUNT(rev_id) AS Community_endorsements FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ...
{"resultsets": [{"headers": ["year", "month", "Community_endorsements"], "rowcount": 21}, {"headers": ["year", "month", "WMF_endorsements"], "rowcount": 18}]}
null
Learning patterns created
null
SELECT r.rev_user_text, p.page_title, r.rev_timestamp FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id INNER JOIN metawiki_p.categorylinks as cl ON p.page_id = cl.cl_from WHERE p.page_namespace IN (200) AND cl.cl_to LIKE "Education_patterns" AND r.rev_parent_id = 0 AND r.rev_user NOT...
{"resultsets": [{"headers": ["rev_user_text", "page_title", "rev_timestamp"], "rowcount": 3}]}
null
Learning pattern edits
null
SELECT r.rev_user_text, p.page_title, r.rev_timestamp FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id INNER JOIN metawiki_p.categorylinks as cl ON p.page_id = cl.cl_from WHERE p.page_namespace IN (200) AND cl.cl_to LIKE "Education_patterns" AND r.rev_parent_id != 0 AND r.rev_user NO...
{"resultsets": [{"headers": ["rev_user_text", "page_title", "rev_timestamp"], "rowcount": 48}]}
null
Bikoret draft
null
use hewiki_p; select max(rev_timestamp) as date, replace(page_title, "_", " ") as "article_name" from revision_userindex inner join page on page_id=rev_page where page_namespace=0 and page_is_redirect=0 and 0 in (locate("'", page_title), locate('"', page_title)) and rev_user not in (select ug_user from user_groups wher...
{"resultsets": [{"headers": ["date", "article_name"], "rowcount": 1000}]}
null
All pages in the category 'user testing' on MediaWiki
https://www.mediawiki.org/wiki/Category:User_testing. Includes the month and year the page was created, and who created it.
SELECT page_title, rev_user_text, EXTRACT(YEAR FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `year`, EXTRACT(MONTH FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `month`, rev_comment FROM mediawikiwiki_p.page AS p JOIN mediawikiwiki_p.categorylinks AS cl ON p.page_id = cl.cl_from JOIN mediawikiwiki_p.revis...
{"resultsets": [{"headers": ["page_title", "rev_user_text", "year", "month", "rev_comment"], "rowcount": 22}]}
null
Wikitraduttori autoverificati
null
USE itwiki_p; SELECT user_name FROM user, user_groups WHERE user_id = ug_user AND ug_group = 'autopatrolled' AND user_name IN ( SELECT page_title FROM page WHERE page_namespace = 2 AND page_is_redirect = 0 AND page_title NOT LIKE '%/%' AND page_id IN ( SELECT cl_from FROM categorylinks WHERE cl_to LIKE "Wikitraduttori_...
{"resultsets": [{"headers": ["user_name"], "rowcount": 62}]}
null
My first query :)
null
#SELECT * FROM enwiki_p.user WHERE user_name = "Jtmorgan"; #3741656 #run this query when you want to remember the page id of the AN/EW page #SELECT * from enwiki_p.page where page_title LIKE "%dministrators'_noticeboard" and page_namespace IN (4,5); SELECT DISTINCT rev_user_text from enwiki_p.revision WHERE rev_page...
{"resultsets": [{"headers": ["rev_user_text"], "rowcount": 28}]}
null
Autopatrolled users on itwiki and enwiki
null
SELECT user_name FROM itwiki_p.user, itwiki_p.user_groups WHERE user_id = ug_user AND ug_group = 'autopatrolled' AND user_name IN ( SELECT user_name FROM enwiki_p.user, enwiki_p.user_groups WHERE user_id = ug_user AND ug_group = 'autoreviewer')
{"resultsets": [{"headers": ["user_name"], "rowcount": 6}]}
null
Autopatrolled users on itwiki and dewiki
null
SELECT user_name FROM itwiki_p.user, itwiki_p.user_groups WHERE user_id = ug_user AND ug_group = 'autopatrolled' AND user_name IN ( SELECT user_name FROM dewiki_p.user, dewiki_p.user_groups WHERE user_id = ug_user AND ug_group = 'autoreview')
{"resultsets": [{"headers": ["user_name"], "rowcount": 58}]}
null
Images tagged with both {{Free media}} and {{Non-free media}} on enwiki
Images tagged with both {{Free media}} nor {{Non-free media}} on enwiki
use enwiki_p; SELECT page_title FROM page, image WHERE page.page_namespace = 6 AND page.page_title = image.img_name AND page_id IN ( SELECT DISTINCT(tl_from) FROM templatelinks WHERE tl_namespace = 10 AND tl_from_namespace = 6 AND tl_title IN ('Free_media') ...
{"resultsets": [{"headers": ["page_title"], "rowcount": 464}]}
null
Quarterly
null
#-----LEARNING PATTERN EDITS #edits to the LEARNING PATTERNS by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_community FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.pa...
{"resultsets": [{"headers": ["year", "edits_community"], "rowcount": 1}, {"headers": ["year", "edits_WMF"], "rowcount": 1}, {"headers": ["year", "editors_Community"], "rowcount": 1}, {"headers": ["year", "editors_WMF"], "rowcount": 1}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"head...
null
Duplicate labels and aliases
null
SELECT term_entity_id, term_language, term_text, term_type FROM `wikidatawiki_p`.`wb_terms` WHERE term_entity_type = 'property' GROUP BY term_search_key HAVING COUNT(*) > 1 LIMIT 100
{"resultsets": [{"headers": ["term_entity_id", "term_language", "term_text", "term_type"], "rowcount": 100}]}
null
Non-templates in Template-only categories
The following pages are non-templates contained in template-only categories. I've now cleaned up most of them and those that remain are valid (they're not technically templates, but they serve as templates). This was done as part of work on licensing metrics (see https://wikimania2015.wikimedia.org/wiki/Submissions/Wha...
use commonswiki_p; SELECT page_namespace, page_title FROM page WHERE page_namespace NOT IN (10, 2, 100, 106, 14) AND page_ID IN ( SELECT cl_from FROM categorylinks WHERE cl_to IN ( SELECT page_title FROM page WHERE...
{"resultsets": [{"headers": ["page_namespace", "page_title"], "rowcount": 237}]}
null
WMIL ocr in Wikisource
דף זה מציג את האורך של דפים שנוצרו בוויקיטקסט באמצעות כלי טכני של עמותת ויקימדיה ישראל. השאילתה עובדת עבור דפים שמכלילים עמודים - ולא למבנים אחרים של דפים
use hewikisource_p; /* use hebrew wikisource database */ select ocr_subpages.page_title, sum(ocr_text.page_len) from categorylinks inner join page as ocr_page on /* all the pages in category עמותה OCR */ ocr_page.page_id=cl_from inner join page as ocr_subpages on /* subpages of ocr_page */ ocr_subpages.page_nam...
{"resultsets": [{"headers": ["page_title", "sum(ocr_text.page_len)"], "rowcount": 17}]}
null
'Cc-by-sa-3.0-heirs' files uploaded in 2015 to Commons
Returns the number of files uploaded to Commons in 2015 that have the 'Cc-by-sa-3.0-heirs' template
use commonswiki_p; SELECT count(page_title) FROM page, image WHERE page.page_namespace = 6 AND page.page_title = image.img_name AND image.img_timestamp LIKE '2015%' AND page_id IN ( SELECT DISTINCT(tl_from) FROM templatelinks WHERE tl_title = 'Cc-by-sa-3.0...
{"resultsets": [{"headers": ["count(page_title)"], "rowcount": 1}]}
null
Find the timestamp of the first revision of a page
null
use commonswiki_p; SELECT MIN(rev_timestamp) FROM revision WHERE rev_page = 3102720;
{"resultsets": [{"headers": ["MIN(rev_timestamp)"], "rowcount": 1}]}
null
Voci con avvisi E e P create da utenti con meno di 100 edit
null
USE itwiki_p; SELECT page_title FROM page INNER JOIN templatelinks AS tl1 ON tl1.tl_from = page_id AND tl1.tl_namespace = 10 AND tl1.tl_title = 'E' INNER JOIN templatelinks AS tl2 ON tl2.tl_from = page_id AND tl2.tl_namespace = 10 AND tl2.tl_title = 'P' INNER JOIN revision ON rev_page = page_id AND rev_parent_id = 0 IN...
{"resultsets": [{"headers": ["page_title"], "rowcount": 38}]}
null
Flagged revisions. Average reviewers per month
null
SELECT avg(uc) AS avg_reviewers_per_day, avg(cc) AS avg_reviews_per_day, floor(avg(cc)/avg(uc)) AS avg_reviews_per_reviewer, floor(d/100) AS dd FROM ( SELECT sum(1) as uc, sum(c) as cc, d from ( SELECT sum(1) as c, log_user_text, floor(log_timestamp/1000000) as d FROM alswiki_p.logging WHERE log_action IN ('approve', '...
{"resultsets": [{"headers": ["avg_reviewers_per_day", "avg_reviews_per_day", "avg_reviews_per_reviewer", "dd"], "rowcount": 81}]}
null
Flagged revisions. Average reviewers per month
null
SELECT sum(1) as uc, sum(c) as cc, d from ( SELECT sum(1) as c, log_user_text, floor(log_timestamp/1000000) as d FROM alswiki_p.logging WHERE log_action IN ('approve', 'approve2') group by log_user,d ) AS tmp where d >20150500 group by d
{"resultsets": [{"headers": ["uc", "cc", "d"], "rowcount": 61}]}
null
Voci con avvisi E o P create da utenti con meno di 100 edit
null
USE itwiki_p; SELECT page_title FROM page, revision WHERE page_id = rev_page AND page_is_redirect = 0 AND rev_parent_id = 0 AND rev_user IN (SELECT user_id FROM user WHERE user_editcount < 100) AND page_namespace = 0 AND page_id IN (SELECT tl_from FROM templatelinks WHERE tl_namespace = 10 AND tl_title IN ('E', 'P'));
{"resultsets": [{"headers": ["page_title"], "rowcount": 1070}]}
null
Number of edits marked as minor for [[w:en:Bee]]
null
use enwiki_p; SELECT COUNT(*) FROM revision WHERE rev_minor_edit = 1 AND rev_page = 4654;
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
Monthly number of edits made to [[w:en:Bee]]
SQL was inspired by https://meta.wikimedia.org/wiki/Research:Recent_global_monthly_registrations_(2015)
use enwiki_p; SELECT LEFT(rev_timestamp, 6) AS month, COUNT(*) as edits FROM revision WHERE rev_page = 4654 GROUP BY month;
{"resultsets": [{"headers": ["month", "edits"], "rowcount": 149}]}
null
Number of revisions for [[w:en:Bee]]
null
SELECT COUNT(*) FROM revision WHERE rev_page = 4654;
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
Logged-in editors of [[w:en:Bee]] by number of edits
See also http://quarry.wmflabs.org/query/4243 for IP editors
use enwiki_p; SELECT rev_user as user, COUNT(*) as edits FROM revision WHERE rev_page = 4654 AND rev_user != 0 GROUP BY user ORDER BY edits DESC;
{"resultsets": [{"headers": ["user", "edits"], "rowcount": 920}]}
null
Unregistered editors of [[w:en:Bee]] by number of edits
See also http://quarry.wmflabs.org/query/4241 for logged-in editors
use enwiki_p; SELECT rev_user_text as unregistered_user, COUNT(*) as edits FROM revision WHERE rev_page = 4654 AND rev_user = 0 GROUP BY unregistered_user ORDER BY edits DESC;
{"resultsets": [{"headers": ["unregistered_user", "edits"], "rowcount": 727}]}
null
Number of edits to [[w:en:Bee]] with no edit summary
null
use enwiki_p; SELECT COUNT(*) FROM revision WHERE rev_comment = '' AND rev_page = 4654;
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
zhwikisource revisions with a timestamp from 19xx
null
use zhwikisource_p; SELECT rev_timestamp, rev_id FROM revision WHERE rev_timestamp LIKE '19%'
{"resultsets": [{"headers": ["rev_timestamp", "rev_id"], "rowcount": 581}]}
null
Detect transcluded templates with duplicate arguments
Detect transcluded templates in [[Category:Pages_using_duplicate_arguments_in_template_calls]]
use commonswiki_p; select page_namespace, page_title, count(*) as transclusion_count from page join categorylinks on page_id = cl_from join templatelinks on page_title = tl_title and page_namespace = tl_namespace where cl_to = 'Pages_using_duplicate_arguments_in_template_calls' group by p...
{"resultsets": [{"headers": ["page_namespace", "page_title", "transclusion_count"], "rowcount": 4}]}
null
Edits to Halfak (WMF)'s talk page on English Wikipedia
null
SELECT COUNT(rev_id) FROM user INNER JOIN page talk_page ON REPLACE(user_name, " ", "_") = page_title AND page_namespace = 3 INNER JOIN revision ON rev_page = page_id WHERE user_name = "Halfak (WMF)";
{"resultsets": [{"headers": ["COUNT(rev_id)"], "rowcount": 1}]}
null
enwikisource 50,000 deleted revisions
null
USE enwikisource_p; SELECT count(log_id) FROM logging WHERE log_action = "delete" AND log_action = "delete" AND log_namespace = "0" ;
{"resultsets": [{"headers": ["count(log_id)"], "rowcount": 1}]}
null
commons wiki deleted revisions
null
USE commonswiki_p; SELECT count(log_id) FROM logging WHERE log_action = "delete" AND log_action = "delete" AND log_namespace = "0" ;
{"resultsets": [{"headers": ["count(log_id)"], "rowcount": 1}]}
null
enwiki deleted revisions
null
USE enwiki_p; SELECT count(log_id) FROM logging WHERE log_action = "delete" AND log_action = "delete" AND log_namespace = "0" ;
{"resultsets": [{"headers": ["count(log_id)"], "rowcount": 1}]}
null
Active editors on enwiki
Example of https://meta.wikimedia.org/wiki/Research:Rolling_active_editor for a medium-size wiki and a short time period. This query has been simplified not to include the username and registration date, so as to avoid a join on the user table.
use enwiki_p; SET @n = 5; /* edits threshold */ SET @u = 30; /* activity unit in days */ SET @T = "20150609"; /* to replace with dynamic value */ SELECT user FROM ( /* Get revisions to content pages that are still visible */ SELECT rev_user as user, SUM(rev_id IS NOT NULL) AS revisions ...
{"resultsets": [{"headers": ["user"], "rowcount": 40008}]}
null
Kotz draft
null
use hewiki_p; select page_title, el_to, el_index from page join externallinks on page_id = el_from where el_index like "%action=edit%" and page_namespace = 0
{"resultsets": [{"headers": ["page_title", "el_to", "el_index"], "rowcount": 5}]}
null
Eran draft
null
use hewiki_p; select page_title, el_to, el_index, page_id from page join externallinks on page_id = el_from where page_title = "בית_אנוביס"; select * from pagelinks where pl_from = 903184
{"resultsets": [{"headers": ["page_title", "el_to", "el_index", "page_id"], "rowcount": 3}, {"headers": ["pl_from", "pl_namespace", "pl_title", "pl_from_namespace"], "rowcount": 49}]}
null
Links to other Wikipedia articles (lvwiki)
null
use lvwiki_p; select iw.iwl_from, iw.iwl_title, count(iw.iwl_title) from iwlinks iw join page p on iw.iwl_from=p.page_id where p.page_namespace=0 and iwl_title not like "Category:%" and iwl_title not like "Wikipedia:%" and iwl_prefix<>"commons" group by iw.iwl_title order by count(*) desc limit 25;
{"resultsets": [{"headers": ["iwl_from", "iwl_title", "count(iw.iwl_title)"], "rowcount": 25}]}
null
Categories about taxons in arwiki missing interwiki
null
USE wikidatawiki_p; SELECT sitelink.ips_site_page AS category, CONCAT("Q",epp_entity_id) AS category_item, CONCAT("Q",term_entity_id) AS taxon_item, COUNT(items.ips_site_page) AS number_of_sitelinks /* FROM (SELECT * FROM pagelinks WHERE pl_title = "Q4167836" AND pl_from_namespace = 0) AS categories JOIN wb_entity_pe...
{"resultsets": [{"headers": ["category", "category_item", "taxon_item", "number_of_sitelinks"], "rowcount": 0}]}
null
AF items
null
use fawiki_p; select * from abuse_filter;
{"resultsets": [{"headers": ["af_id", "af_pattern", "af_user", "af_user_text", "af_timestamp", "af_enabled", "af_comments", "af_public_comments", "af_hidden", "af_hit_count", "af_throttled", "af_deleted", "af_actions", "af_global", "af_group"], "rowcount": 128}]}
null
ArWiki Users and their groups
USER_Editcount between 200 and 1500 (requested by محمد الفلسطيني)
use arwiki_p; SELECT user_name, user_editcount,user_registration, GROUP_CONCAT(ug_group) FROM `user` JOIN user_groups ON ug_user = user_id group by user_name having user_editcount BETWEEN 200 AND 15000 order by user_registration DESC ;
{"resultsets": [{"headers": ["user_name", "user_editcount", "user_registration", "GROUP_CONCAT(ug_group)"], "rowcount": 905}]}
null
Pages without URL in missing information category in commons
null
use commonswiki_p; select page_title from externallinks join categorylinks on cl_from = el_from join page on cl_from = page_id where cl_to = 'Media_missing_infobox_template';
{"resultsets": [{"headers": ["page_title"], "rowcount": 1317478}]}
null
Kotz draft
null
use hewiki_p; select page_title from page where exists (select * from templatelinks where tl_from = page_id and tl_title = "הערה") and not exists (select * from templatelinks where tl_from = page_id and tl_title = "הערות_שוליים")
{"resultsets": [{"headers": ["page_title"], "rowcount": 1064}]}
null
Chen draft
null
use hewiki_p; select replace(page_title, "_", " ") as "ערך", page_len as "גודל" from page as p1 where exists (select * from page as p3 where p1.page_title = p3.page_title and p3.page_namespace = 1 and exists (select * from categorylinks where cl_from = p3.page_id and replace(cl_to, "_", " ") in ('ערכים שנוצרו במס...
{"resultsets": [{"headers": ["\u05e2\u05e8\u05da", "\u05d2\u05d5\u05d3\u05dc"], "rowcount": 65}, {"headers": ["\u05db\u05de\u05d5\u05ea", "\u05e1\u05db\u05d5\u05dd"], "rowcount": 1}, {"headers": ["\u05e2\u05e8\u05da", "\u05d2\u05d5\u05d3\u05dc"], "rowcount": 112}, {"headers": ["\u05db\u05de\u05d5\u05ea", "\u05e1\u05db\...
null
ArWiki Users without group
Users not assigned to any group
use arwiki_p; SELECT user_name, user_editcount,user_registration FROM `user` where user_id not in (select ug_user from user_groups) and user_editcount BETWEEN 200 AND 15000 order by user_registration DESC ;
{"resultsets": [{"headers": ["user_name", "user_editcount", "user_registration"], "rowcount": 911}]}
null
Getting the "big" total of images in WLM 201X
Getting a "big" total per year of WLM images uploaded to the contests
use commonswiki_p; select 2011 year, count(1) images from categorylinks where cl_to = 'Images_from_Wiki_Loves_Monuments_2011' and cl_type = 'file' union select 2012, count(1) images from categorylinks where cl_to = 'Images_from_Wiki_Loves_Monuments_2012' and cl_type = 'file' union select 2013, count(1) images from cate...
{"resultsets": [{"headers": ["year", "images"], "rowcount": 4}]}
null
Getting user / images from WLMCL 2013
null
use commonswiki_p; select 2011 year, count(distinct img_user) users, count(1) images from categorylinks join page on page_id = cl_from join image on img_name = page_title where cl_to = 'Images_from_Wiki_Loves_Monuments_2013_in_Chile' and cl_type = 'file';
{"resultsets": [{"headers": ["year", "users", "images"], "rowcount": 1}]}
null
Random 20k revisions from 2014 (idwiki)
Gets a random sample of revisions from 2014.
USE idwiki_p; SELECT rev_id, rev_page AS page_id FROM revision_userindex WHERE rev_timestamp BETWEEN "20140101" AND "20150101" ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 20000}]}
null
50,000 revisions from idwiki for revscores
null
USE idwiki_p; SELECT rev_id, rev_page AS page_id FROM revision_userindex WHERE rev_timestamp BETWEEN "20140101" AND "20150101" ORDER BY RAND() LIMIT 50000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 50000}]}
null
50,000 revisions from eswiki for revscores
null
USE eswiki_p; SELECT rev_id, rev_page AS page_id FROM revision_userindex WHERE rev_timestamp BETWEEN "20140101" AND "20150101" ORDER BY RAND() LIMIT 50000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 50000}]}
null
Edits last week
null
SELECT COUNT(*) AS 'Edits last week' FROM svwiki_p.revision JOIN svwiki_p.page ON rev_page = page_id JOIN svwiki_p.user ON rev_user = user_id WHERE page_namespace = 0 AND user_name = 'Ainali'
{"resultsets": [{"headers": ["Edits last week"], "rowcount": 1}]}
null
What's Yuvi up to in Enwiki?
null
USE enwiki_p; SELECT page_namespace, COUNT(*) FROM revision_userindex INNER JOIN page ON rev_page = page_id WHERE rev_user_text = "Yuvipanda" GROUP BY page_namespace; SELECT cl_to, COUNT(*) FROM revision_userindex INNER JOIN categorylinks ON cl_from = rev_page WHERE rev_user_text = "Yuvipanda" GROUP BY cl_to;
{"resultsets": [{"headers": ["page_namespace", "COUNT(*)"], "rowcount": 10}, {"headers": ["cl_to", "COUNT(*)"], "rowcount": 911}]}
null
Enwiki drafts and daily new drafts
null
SELECT COUNT(*) FROM page WHERE page_namespace = 118; SELECT LEFT(first_timestamp, 8) AS day, COUNT(*) FROM (SELECT page_id, MIN(rev_timestamp) AS first_timestamp FROM page INNER JOIN revision ON rev_page = page_id WHERE page_namespace = 118 AND rev_timestamp BETWEEN "20150601" AND "20150701" GROUP BY 1) AS pag...
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}, {"headers": ["day", "COUNT(*)"], "rowcount": 30}]}
null
Number of articles that need something (enwiki)
null
SELECT COUNT(DISTINCT cl_from) FROM categorylinks WHERE cl_to LIKE "Articles_needing%";
{"resultsets": [{"headers": ["COUNT(DISTINCT cl_from)"], "rowcount": 1}]}
null
New editors per day June 2015 (enwiki)
null
SELECT COUNT(DISTINCT rev_user) FROM revision_userindex INNER JOIN logging_userindex ON rev_user = log_user AND log_type = "newusers" AND log_action = "create" WHERE log_timestamp BETWEEN "20150601" AND "20150701";
{"resultsets": [{"headers": ["COUNT(DISTINCT rev_user)"], "rowcount": 1}]}
null