title
stringlengths
1
212
description
stringlengths
1
4.39k
query
stringlengths
1
65.5k
extra_info
stringlengths
18
31.6k
wikidb
stringlengths
4
26
Bora draft
null
use enwiki_p; select page_title as "ערך", page_is_redirect as "הפניה", page_len as "גודל", ll_title as "שם בעברית" from page join langlinks on (exists (select * from categorylinks where cl_to = "Mayors_of_places_in_the_United_States" and cl_from = page_id) or exists (select * from categorylinks where cl_from = page_id and exists (select * from page as p1 where p1.page_namespace = 14 and p1.page_title = cl_to and exists (select * from categorylinks as c1 where c1.cl_from = p1.page_id and exists (select * from page as p2 where p2.page_namespace = 14 and p2.page_title = c1.cl_to and exists (select * from categorylinks as c2 where c2.cl_from = p2.page_id and c2.cl_to = "Mayors_of_places_in_the_United_States"))))) or exists (select * from categorylinks where cl_from = page_id and exists (select * from page as p1 where p1.page_namespace = 14 and p1.page_title = cl_to and exists (select * from categorylinks as c1 where c1.cl_from = p1.page_id and c1.cl_to = "Mayors_of_places_in_the_United_States")))) and page_namespace = 0 and page_id = ll_from and ll_lang = "he"
{"resultsets": [{"headers": ["\u05e2\u05e8\u05da", "\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05d2\u05d5\u05d3\u05dc", "\u05e9\u05dd \u05d1\u05e2\u05d1\u05e8\u05d9\u05ea"], "rowcount": 52}]}
null
Bora draft
null
set @en = "Mayors of places in the United_States"; set @he = "ראשי ערים בארצות הברית"; use enwiki_p; set @s = replace(@en, " ", "_"); set @t = replace(@he, " ", "_"); select ll_title as "שם" from page inner join langlinks on page_namespace = 0 and exists (select * from categorylinks where cl_from = page_id and (cl_to = @s or exists (select * from page as p1 where p1.page_title = cl_to and p1.page_namespace = 14 and exists (select * from categorylinks as c1 where c1.cl_from = p1.page_id and (c1.cl_to = @s or exists (select * from page as p2 where p2.page_title = c1.cl_to and p2.page_namespace = 14 and exists (select * from categorylinks as c2 where c2.cl_from = p2.page_id and c2.cl_to = @s))))))) and page_id = ll_from and ll_lang = "he" and exists (select * from hewiki_p.page as p3 where p3.page_namespace = 0 and p3.page_title = replace(ll_title, " ", "_") and not exists (select * from hewiki_p.categorylinks as c3 where c3.cl_from = p3.page_id and c3.cl_to = @t))
{"resultsets": [{"headers": ["\u05e9\u05dd"], "rowcount": 35}]}
null
קטגוריה:צרפת: בתי כנסת
מוהלים
select page_title as "ערך", page_is_redirect as "הפניה", page_len as "גודל", ll_title as "שם בעברית" from hewiki_p.page join hewiki_p.categorylinks join hewiki_p.langlinks on cl_to = "מוהלים" and cl_from = page_id and page_namespace = 0 and page_id = ll_from and ll_lang = "en"
{"resultsets": [{"headers": ["\u05e2\u05e8\u05da", "\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05d2\u05d5\u05d3\u05dc", "\u05e9\u05dd \u05d1\u05e2\u05d1\u05e8\u05d9\u05ea"], "rowcount": 5}]}
null
شمار ویرایش‌های وظیفه ۸ DbBot
ویکی‌پدیا:سیاست_ربات‌رانی/درخواست_مجوز/dbBot/وظیفه_۸
USE fawiki_p; SELECT count(*) FROM revision WHERE rev_user = 264911 AND rev_comment LIKE "%ویکی‌پدیا:سیاست_ربات‌رانی/درخواست_مجوز/dbBot/وظیفه_۸%";
{"resultsets": [{"headers": ["count(*)"], "rowcount": 1}]}
null
Persone che appongono i template "Tradotto da" dal 2014
null
USE itwiki_p; SELECT rev_user_text, COUNT(*) FROM revision WHERE rev_page IN ( SELECT tl_from FROM templatelinks WHERE tl_title = 'Tradotto_da' AND tl_namespace = 10 AND tl_from_namespace = 1) AND rev_parent_id = 0 AND rev_timestamp > 20140000000000 GROUP BY rev_user_text HAVING COUNT(*) >= 10 ORDER BY COUNT(*) DESC
{"resultsets": [{"headers": ["rev_user_text", "COUNT(*)"], "rowcount": 120}]}
null
Global renames (count)
null
USE metawiki_p; SELECT user_name AS user, COUNT(log_timestamp) AS renames FROM logging JOIN user ON user_id = log_user WHERE log_type = 'gblrename' #AND log_action = '?' GROUP BY log_user ORDER by renames DESC;
{"resultsets": [{"headers": ["user", "renames"], "rowcount": 98}]}
null
Wikidata - given names - frequency of names (en + other lang)
runtime > 3 min
# Frequency of given name items linked from page [[User:Jura1/first names/items (P31: ok, label: tbd)]] # # See also https://upload.wikimedia.org/wikipedia/commons/f/f7/MediaWiki_1.24.1_database_schema.svg # use wikidatawiki_p; # SELECT page_title AS item, term_type, GROUP_CONCAT(DISTINCT term_language ORDER BY term_language) As lang, GROUP_CONCAT(DISTINCT term_text ORDER BY term_language SEPARATOR ', ') As name, CONCAT('<tr><td> [[', page_title, '|', term_text, ']] <td>', COUNT(DISTINCT pl2.pl_from) ) As table_output_in_one_cell, COUNT(DISTINCT pl2.pl_from ) As freq, CURRENT_DATE # FROM pagelinks As pl1, page, wb_entity_per_page, wb_terms, pagelinks AS pl2 # WHERE pl1.pl_from = 21293912 # id of page [[d:User:Jura1/first names/items (P31: ok, label: tbd)]] AND pl1.pl_namespace = 0 AND pl2.pl_namespace = 0 AND pl1.pl_title = page_title AND page_id = epp_page_id AND epp_entity_id = term_entity_id AND term_entity_type = 'item' # 'item' not 'property' AND term_type = 'label' # 'label', 'description', 'alias' AND term_language in ('en','sr') AND pl1.pl_title = pl2.pl_title GROUP BY epp_entity_id HAVING COUNT(pl2.pl_from)>99
{"resultsets": [{"headers": ["item", "term_type", "lang", "name", "table_output_in_one_cell", "freq", "CURRENT_DATE"], "rowcount": 2595}]}
null
Persone che appongono i template "Tradotto da" dal 2007
null
USE itwiki_p; SELECT rev_user_text, COUNT(*) FROM revision WHERE rev_page IN ( SELECT tl_from FROM templatelinks WHERE tl_title = 'Tradotto_da' AND tl_namespace = 10 AND tl_from_namespace = 1) AND rev_parent_id = 0 AND rev_timestamp > 20070000000000 GROUP BY rev_user_text HAVING COUNT(*) >= 10 ORDER BY COUNT(*) DESC
{"resultsets": [{"headers": ["rev_user_text", "COUNT(*)"], "rowcount": 618}]}
null
Zion draft
null
set @category = "People from Dublin (city)"; select page_title as "ערך", page_is_redirect as "הפניה", page_len as "גודל", ll_title as "שם בעברית" from enwiki_p.page join enwiki_p.categorylinks join enwiki_p.langlinks on cl_to = replace(@category, " ", "_") and cl_from = page_id and page_namespace = 0 and page_id = ll_from and ll_lang = "he"
{"resultsets": [{"headers": ["\u05e2\u05e8\u05da", "\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05d2\u05d5\u05d3\u05dc", "\u05e9\u05dd \u05d1\u05e2\u05d1\u05e8\u05d9\u05ea"], "rowcount": 25}]}
null
Hewiki articles with maybe unexisting pictures
null
use hewiki_p; select CASE p1.page_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש" WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ" WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה" WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל" WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה" WHEN 829 THEN "שיחת יחידה" ELSE p1.page_namespace END as 'מרחב השם', p1.page_title as 'שם הערך' from page as p1 where p1.page_namespace in (-2, -1, 0, 4, 6, 8, 10, 12, 14, 100, 828, 108, 446) and exists (select * from pagelinks where pl_from = p1.page_id and pl_namespace = 6 and not exists (select * from page as p2 where p2.page_namespace = 6 and p2.page_title = pl_title))
{"resultsets": [{"headers": ["\u05de\u05e8\u05d7\u05d1 \u05d4\u05e9\u05dd", "\u05e9\u05dd \u05d4\u05e2\u05e8\u05da"], "rowcount": 4044}]}
null
Hewiki short articles
null
USE hewiki_p; SELECT page_len, page_title FROM page WHERE page_namespace = 0 AND page_len < 1500 AND page_is_redirect = 0 AND NOT page_title REGEXP ".*[0-9].*" AND NOT EXISTS (SELECT * FROM templatelinks WHERE page_id = tl_from AND tl_title in ("פירושונים", "בעבודה", "בעבודה_אקדמית", "הפרת_זכויות_יוצרים"))
{"resultsets": [{"headers": ["page_len", "page_title"], "rowcount": 8383}]}
null
Uncategorized Wikipedia and Wikipedia talk pages on huwiki
null
use huwiki_p; SELECT concat('# [[Wikipédia:', page_title, ']]') as 'Wikipédia' FROM page LEFT JOIN categorylinks ON cl_from = page_id WHERE cl_from IS NULL and page_namespace = 4 and page_is_redirect = 0; SELECT concat('# [[Wikipédia-vita:', page_title, ']]') as 'Wikipédia-vita' FROM page LEFT JOIN categorylinks ON cl_from = page_id WHERE cl_from IS NULL and page_namespace = 5 and page_is_redirect = 0;
{"resultsets": [{"headers": ["Wikip\u00e9dia"], "rowcount": 678}, {"headers": ["Wikip\u00e9dia-vita"], "rowcount": 1246}]}
null
مقاله‌های شهرستان‌های ایران با تغییرمسیر از بخش
مقاله‌هایی از شهرستان‌های ایران که از عنوانی «بخش...» تغییرمسیر دارند. ایرانی بودن از روی داشتن الگویی با عنوان ایران تشخیص داده شده.
USE fawiki_p; SELECT DISTINCT rd_title AS 'عنوان مقاله', rd_source.page_title AS 'عنوان صفحهٔ تغییرمسیر' FROM redirect LEFT JOIN page rd_target ON rd_title = page_title LEFT JOIN page rd_source ON rd_source.page_id = rd_from WHERE rd_namespace = 0 AND rd_source.page_title LIKE 'بخش%' AND rd_target.page_title LIKE 'شهرستان%' AND EXISTS ( SELECT * FROM templatelinks WHERE tl_from = rd_target.page_id AND tl_title LIKE "%ایران%" ) GROUP BY rd_title;
{"resultsets": [{"headers": ["\u0639\u0646\u0648\u0627\u0646 \u0645\u0642\u0627\u0644\u0647", "\u0639\u0646\u0648\u0627\u0646 \u0635\u0641\u062d\u0647\u0654 \u062a\u063a\u06cc\u06cc\u0631\u0645\u0633\u06cc\u0631"], "rowcount": 24}]}
null
Daily anonymous mobile edits, German Wikipedia
see http://quarry.wmflabs.org/query/1242 , http://quarry.wmflabs.org/query/2256 http://quarry.wmflabs.org/query/2634 http://www.gossamer-threads.com/lists/wiki/wikitech/582998 https://meta.wikimedia.org/wiki/Research:Mobile_anonymous_apocalypse
/* Forked from http://quarry.wmflabs.org/query/948 */ USE dewiki_p; SELECT LEFT(rev_timestamp, 8) AS date, COUNT(*) FROM revision_userindex INNER JOIN tag_summary ON ts_rev_id = rev_id AND ts_tags LIKE "%mobile web edit%" WHERE rev_timestamp BETWEEN "20150101" AND "20150428" AND rev_user = 0 GROUP BY date;
{"resultsets": [{"headers": ["date", "COUNT(*)"], "rowcount": 42}]}
null
Daily anonymous mobile edits, Italian Wikipedia
see http://quarry.wmflabs.org/query/1242 , http://quarry.wmflabs.org/query/2256 http://quarry.wmflabs.org/query/2634 http://quarry.wmflabs.org/query/3376 http://www.gossamer-threads.com/lists/wiki/wikitech/582998 https://meta.wikimedia.org/wiki/Research:Mobile_anonymous_apocalypse
/* Forked from http://quarry.wmflabs.org/query/948 */ USE itwiki_p; SELECT LEFT(rev_timestamp, 8) AS date, COUNT(*) FROM revision_userindex INNER JOIN tag_summary ON ts_rev_id = rev_id AND ts_tags LIKE "%mobile web edit%" WHERE rev_timestamp BETWEEN "20150101" AND "20150429" AND rev_user = 0 GROUP BY date;
{"resultsets": [{"headers": ["date", "COUNT(*)"], "rowcount": 107}]}
null
Women scientists of contested notability (enwiki)
Articles tagged by WikiProject Women Scientists that are also in the category "All articles with topics of unclear notability"
use enwiki_p; select page.page_title from page inner join categorylinks on page.page_id=categorylinks.cl_from where page_namespace = 0 and cl_to = "All_articles_with_topics_of_unclear_notability" and page_title in (select distinct page.page_title from categorylinks inner join page on categorylinks.cl_from = page.page_id where page_namespace = 1 and (cl_to = "A-Class_Women_scientists_articles" or cl_to = "B-Class_Women_scientists_articles" or cl_to = "C-Class_Women_scientists_articles" or cl_to = "Disambig-Class_Women_scientists_articles" or cl_to = "FA-Class_Women_scientists_articles" or cl_to = "FL-Class_Women_scientists_articles" or cl_to = "GA-Class_Women_scientists_articles" or cl_to = "List-Class_Women_scientists_articles" or cl_to = "Start-Class_Women_scientists_articles" or cl_to = "Stub-Class_Women_scientists_articles" or cl_to = "Unassessed_Women_scientists_articles"));
{"resultsets": [{"headers": ["page_title"], "rowcount": 41}]}
null
daily wikidata edits "new editor removing sitelink"
daily wikidata edits "new editor removing sitelink" 2015-01-01 to 2015-04-29 http://quarry.wmflabs.org/query/3376 https://www.wikidata.org/wiki/Special:Tags
USE wikidatawiki_p; SELECT LEFT(rev_timestamp, 8) AS date, COUNT(*) FROM revision_userindex INNER JOIN tag_summary ON ts_rev_id = rev_id AND ts_tags LIKE "%new editor removing sitelink%" WHERE rev_timestamp BETWEEN "20150101" AND "20150429" AND rev_user = 0 GROUP BY date;
{"resultsets": [{"headers": ["date", "COUNT(*)"], "rowcount": 118}]}
null
Ogen draft
null
use hewiki_p; select tl_from, tl_from_namespace from templatelinks where tl_title = "עוגן"; select tl_from, tl_from_namespace from templatelinks where tl_title = "עוגן2"
{"resultsets": [{"headers": ["tl_from", "tl_from_namespace"], "rowcount": 479}, {"headers": ["tl_from", "tl_from_namespace"], "rowcount": 148}]}
null
Bora wikidata
null
use wikidatawiki_p; SELECT term_entity_id, term_text from wb_terms WHERE term_entity_type = 'property' AND term_language = 'he' and term_type = 'label' ORDER bY term_entity_id;
{"resultsets": [{"headers": ["term_entity_id", "term_text"], "rowcount": 498}]}
null
itwiki articles with {{Link V}} or {{Link VdQ}}
null
USE itwiki_p; SELECT COUNT(DISTINCT(page_title)) FROM page INNER JOIN templatelinks ON tl_from = page_id AND tl_namespace = 10 AND tl_title IN ('Link_V', 'Link_VdQ') WHERE page_namespace = 0
{"resultsets": [{"headers": ["COUNT(DISTINCT(page_title))"], "rowcount": 1}]}
null
פעיל
null
set @category = "Burials at Père Lachaise Cemetery"; select page_title as "ערך", ll_title as "שם בעברית" from enwiki_p.page join enwiki_p.categorylinks join enwiki_p.langlinks on cl_to = replace(@category, " ", "_") and cl_from = page_id and page_namespace = 0 and page_id = ll_from and ll_lang = "he"
{"resultsets": [{"headers": ["\u05e2\u05e8\u05da", "\u05e9\u05dd \u05d1\u05e2\u05d1\u05e8\u05d9\u05ea"], "rowcount": 171}]}
null
Google Translation Project(2009-2011) Articles
Gives a listing of pages from the category:'గూగుల్_అనువాద_వ్యాసాలు' on tewiki_p
use tewiki_p; SELECT page_title FROM page LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE (page.page_namespace = 0 AND categorylinks.cl_to= 'గూగుల్_అనువాద_వ్యాసాలు') ORDER BY page_title
{"resultsets": [{"headers": ["page_title"], "rowcount": 979}]}
null
itwiki Articles vs Edit count
null
use svwiki_p; SELECT rev_user_text, min(rev_timestamp), count(*) e_c, count(distinct rev_page) a_c, count(*)/count(distinct rev_page),rev_user from revision_userindex group by rev_user_text; /*select count(case when rev_deleted>0 then 1 else null end) from revision_userindex where rev_user_text="Chobot";*/
{"resultsets": [{"headers": ["rev_user_text", "min(rev_timestamp)", "e_c", "a_c", "count(*)/count(distinct rev_page)", "rev_user"], "rowcount": 842748}]}
null
lvwiki invalid navbar links
null
use lvwiki_p; SELECT CONCAT('Veidne:', replace(page.page_title, '_', ' ')) AS template, tp.param_value FROM s51454__tmpl_params_p.lvwiki as tp, page WHERE tp.template_name = 'Navbox' AND tp.param_name = 'name' AND tp.page_id = page.page_id AND replace(tp.param_value, '_', ' ') <> replace(page.page_title, '_', ' ')
{"resultsets": [{"headers": ["template", "param_value"], "rowcount": 26}]}
null
Editor Activity on pl
null
use plwiki_p; select rev_user_text,max(rev_timestamp), min(rev_timestamp), count(*) from revision join page on revision.rev_page=page.page_id where page_namespace=0 and page_is_redirect=0 group by rev_user;
{"resultsets": [{"headers": ["rev_user_text", "max(rev_timestamp)", "min(rev_timestamp)", "count(*)"], "rowcount": 140234}]}
null
WikiProject article quality categories (enwiki)
Wikipedia articles, sorted by WikiProject, further sorted by quality. Discover the wonder.
select page_title from page where page_namespace = 14 and (page_title like "%-Class_%_articles" or page_title like "Unassessed_%_articles" or page_title like "WikiProject_%_articles") and page_title not like "%-importance_%" and page_title not like "Wikipedia_%" and page_title not like "Template-%" and page_title not like "Redirect-%" and page_title not like "Project-%" and page_title not like "Portal-%" and page_title not like "File-%" and page_title not like "FM-%" and page_title not like "Category-%" and page_title not like "Cat-%" and page_title not like "Book-%" and page_title not like "NA-%" and page_title not like "%_Operation_Majestic_Titan_%" and page_title not like "%_Version_%" and page_title not like "All_Wikipedia_%" and page_title not like "%_Wikipedia-Books_%" and page_title not like "Assessed-%" and page_title not like "%-Priority_%" and page_title not like "Unassessed_field_%" and page_title not like "Unassessed_importance_%" and page_title not like "Unassessed-Class_articles";
{"resultsets": [{"headers": ["page_title"], "rowcount": 24065}]}
null
Categories on English Wikipedia that are soft redirects
null
use enwiki_p; select page.page_title from page join categorylinks on page.page_id = categorylinks.cl_from where cl_to = "Wikipedia_soft_redirected_categories" and page_namespace = 14;
{"resultsets": [{"headers": ["page_title"], "rowcount": 27363}]}
null
Registered users and edits
null
select * from user where user_registration >'20150401000000' and user_registration < '20150402000000' and (select count(*) from revision_userindex where rev_user = user_id) = user_editcount;
{"resultsets": [{"headers": ["user_id", "user_name", "user_real_name", "user_password", "user_newpassword", "user_email", "user_options", "user_touched", "user_token", "user_email_authenticated", "user_email_token", "user_email_token_expires", "user_registration", "user_newpass_time", "user_editcount", "user_password_expires"], "rowcount": 9781}]}
null
Stub articles created in January
null
use knwiki_p; #desc revision; #desc page; select p.page_title,r.rev_user_text,p.page_len from revision r, page p where r.rev_parent_id = 0 and r.rev_len < 2048 and p.page_len < 2048 and p.page_namespace = 0 and p.page_is_redirect = 0 and rev_timestamp < '20140200000000' and rev_timestamp > '20131231235959' and r.rev_page = p.page_id;
{"resultsets": [{"headers": ["page_title", "rev_user_text", "page_len"], "rowcount": 171}]}
null
WikiTrends-1 Top Contributors
Top contributors for one month of first phase of wikitrends project on tewiki
use tewiki_p; SELECT user_name, COUNT(*) As Edits FROM user LEFT JOIN revision ON rev_user = user_id LEFT JOIN page ON page_id = rev_page WHERE rev_timestamp >= '20140201000000' AND rev_timestamp <= '20140301000000' AND page_namespace = 0 AND page_title IN (SELECT page_title FROM page JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE page.page_namespace = 1 AND categorylinks.cl_to= 'వికీప్రాజెక్టు_నాణ్యతాభివృద్ధి-వికీట్రెండ్స్_పేజీలు') GROUP BY user_name HAVING COUNT(*) > 0 ORDER BY Edits DESC LIMIT 25;
{"resultsets": [{"headers": ["user_name", "Edits"], "rowcount": 19}]}
null
List of articles tagged by WikiProject African Diaspora (enwiki)
A list of articles (technically, article talk pages and draft talk pages) tagged as part of WikiProject African Diaspora. May not be perfect.
use enwiki_p; select distinct page.page_title,page.page_namespace from categorylinks inner join page on categorylinks.cl_from=page.page_id where (page_namespace = 1 or page_namespace = 119) and cl_to in ("A-Class_African_diaspora_articles", "B-Class_African_diaspora_articles", "C-Class_African_diaspora_articles", "FA-Class_African_diaspora_articles", "FL-Class_African_diaspora_articles", "GA-Class_African_diaspora_articles", "List-Class_African_diaspora_articles", "Start-Class_African_diaspora_articles", "Stub-Class_African_diaspora_articles", "Unassessed_African_diaspora_articles");
{"resultsets": [{"headers": ["page_title", "page_namespace"], "rowcount": 3631}]}
null
WikiProject red-link assessment categories (enwiki)
These assessment categories are in use throughout English Wikipedia but do not have corresponding category pages.
use enwiki_p; select distinct cl_to from categorylinks left join page on cl_to = page_title and page_namespace = 14 where (cl_to like "%-Class_%_articles" or cl_to like "Unassessed_%_articles" or cl_to like "%-importance_%_articles" or cl_to like "%-priority_%_articles") and page_title is null;
{"resultsets": [{"headers": ["cl_to"], "rowcount": 310}]}
null
All Editors
null
use hewiki_p; select rev_user, rev_user_text, max(rev_timestamp), min(rev_timestamp) from revision where rev_user !=0 and lower(CONVERT(rev_user_text USING latin1)) not like '%bot%' group by rev_user having count(*)>4;
{"resultsets": [{"headers": ["rev_user", "rev_user_text", "max(rev_timestamp)", "min(rev_timestamp)"], "rowcount": 30701}]}
null
Active Editors
null
use mrwiki_p; select rev_user, rev_user_text, max(rev_timestamp),min(rev_timestamp), rev_timestamp, count(*) from revision where lower(CONVERT(rev_user_text USING latin1)) not like '%bot%' and rev_user !=0 group by YEAR(rev_timestamp), MONTH(rev_timestamp), rev_user having count(*)>4;
{"resultsets": [{"headers": ["rev_user", "rev_user_text", "max(rev_timestamp)", "min(rev_timestamp)", "rev_timestamp", "count(*)"], "rowcount": 3783}]}
null
Edit quality (20k random sample, 2015) [ptwiki]
null
USE ptwiki_p; SELECT rc_this_oldid AS rev_id FROM recentchanges WHERE rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1) ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id"], "rowcount": 20000}]}
null
Edit quality (20k random sample, 2015) [fawiki]
null
USE fawiki_p; SELECT rc_this_oldid AS rev_id FROM recentchanges WHERE rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1) ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id"], "rowcount": 20000}]}
null
New discussions in the MILHIST-sphere, 24 hour period (enwiki)
From 2015-05-06, 16:45:00 to 2015-05-07, 16:45:00 (UTC)
select distinct recentchanges.rc_title,recentchanges.rc_comment,recentchanges.rc_timestamp,page.page_namespace from recentchanges join page on recentchanges.rc_namespace = page.page_namespace and recentchanges.rc_title = page.page_title join categorylinks on page.page_id=categorylinks.cl_from where rc_timestamp >= 20150506164500 and rc_timestamp < 20150507164500 # i.e. the past 24 hours, roughly and rc_comment like "% new section" and rc_deleted = 0 and cl_to like "%_military_history_articles" order by rc_timestamp desc;
{"resultsets": [{"headers": ["rc_title", "rc_comment", "rc_timestamp", "page_namespace"], "rowcount": 38}]}
null
Edit quality (20k random sample, 2015) [trwiki]
null
USE trwiki_p; SELECT rc_this_oldid AS rev_id FROM recentchanges WHERE rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1) ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id"], "rowcount": 20000}]}
null
Edit quality (20k random sample, 2015) [azwiki]
null
USE azwiki_p; SELECT rc_this_oldid AS rev_id FROM recentchanges WHERE rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1) ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id"], "rowcount": 20000}]}
null
Active Articles
null
use zhwiki_p; select page_title,page_id, rev_timestamp, count(*) from page join revision on page.page_id = revision.rev_page where page_namespace=0 and page_is_redirect=0 and rev_user !=0 and lower(CONVERT(rev_user_text USING latin1)) not like '%bot%' group by YEAR(rev_timestamp), MONTH(rev_timestamp), rev_page having count(*)>4;
{"resultsets": [{"headers": ["page_title", "page_id", "rev_timestamp", "count(*)"], "rowcount": 576625}]}
null
External links in redirects, redux
Code from Dispenser
SELECT page_id, page_namespace, page_title, el_to, COUNT(*) FROM page JOIN externallinks ON el_from=page_id WHERE page_is_redirect=1 AND page_namespace=0 GROUP BY page_id ORDER BY CEIL(LOG10(COUNT(*))), el_index
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "el_to", "COUNT(*)"], "rowcount": 750}]}
null
صفحه‌های دارای بیشترین تراگنجانش با آرگومان تکراری در الگو
Most transcluded pages that use duplicate arguments in template calls
USE fawiki_p; SELECT page_namespace, page_title, count(*) FROM categorylinks LEFT JOIN page ON page_id = cl_from RIGHT JOIN templatelinks ON tl_namespace = page_namespace AND tl_title = page_title WHERE cl_to = 'صفحه‌های_دارای_آرگومان_تکراری_در_فراخوانی_الگو' GROUP BY cl_from ORDER BY COUNT(*) DESC limit 500;
{"resultsets": [{"headers": ["page_namespace", "page_title", "count(*)"], "rowcount": 500}]}
null
Wikitrends-1 top edited pages
Wikitrend project statistics for phase 1,https://te.wikipedia.org/wiki/%E0%B0%B5%E0%B0%BF%E0%B0%95%E0%B1%80%E0%B0%AA%E0%B1%80%E0%B0%A1%E0%B0%BF%E0%B0%AF%E0%B0%BE_%E0%B0%9A%E0%B0%B0%E0%B1%8D%E0%B0%9A:%E0%B0%B5%E0%B0%BF%E0%B0%95%E0%B1%80%E0%B0%AA%E0%B1%8D%E0%B0%B0%E0%B0%BE%E0%B0%9C%E0%B1%86%E0%B0%95%E0%B1%8D%E0%B0%9F%E0%B1%81/%E0%B0%A8%E0%B0%BE%E0%B0%A3%E0%B1%8D%E0%B0%AF%E0%B0%A4%E0%B0%BE%E0%B0%AD%E0%B0%BF%E0%B0%B5%E0%B1%83%E0%B0%A6%E0%B1%8D%E0%B0%A7%E0%B0%BF-%E0%B0%B5%E0%B0%BF%E0%B0%95%E0%B1%80%E0%B0%9F%E0%B1%8D%E0%B0%B0%E0%B1%86%E0%B0%82%E0%B0%A1%E0%B1%8D%E0%B0%B8%E0%B1%8D_1
use tewiki_p; SELECT page_title, COUNT(*) As Edits FROM page LEFT JOIN revision ON revision.rev_page = page.page_id WHERE rev_timestamp >= '20140201000000' AND rev_timestamp <'20140301000000' AND page_namespace = 0 AND page_title in (SELECT page_title FROM page JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE page.page_namespace = 1 AND categorylinks.cl_to= 'వికీప్రాజెక్టు_నాణ్యతాభివృద్ధి-వికీట్రెండ్స్_పేజీలు') GROUP BY page_title HAVING Edits > 0 ORDER BY Edits DESC LIMIT 25;
{"resultsets": [{"headers": ["page_title", "Edits"], "rowcount": 19}]}
null
Featured articles from talk page template
Year wise list of featured articles on tewiki, as given by the template on talk pages
use tewiki_p; SELECT SUBSTRING(categorylinks.cl_to,LENGTH('ఈ_వారం_వ్యాసాల_చర్చలు_-_Y')+1,4) AS featured_year, page_title FROM page LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE page.page_namespace = 1 AND categorylinks.cl_to LIKE 'ఈ_వారం_వ్యాసాల_చర్చలు_-_Y%' ORDER BY featured_year,page_title;
{"resultsets": [{"headers": ["featured_year", "page_title"], "rowcount": 389}]}
null
All Articles
null
use fiwiki_p; select page_title,page_id, min(rev_timestamp), count(*) from page join revision on page.page_id = revision.rev_page where page_namespace=0 and page_is_redirect=0 and lower(CONVERT(rev_user_text USING latin1)) not like '%bot%' group by rev_page having count(*)>4;
{"resultsets": [{"headers": ["page_title", "page_id", "min(rev_timestamp)", "count(*)"], "rowcount": 268810}]}
null
#artandfeminism hashtag usage
Props to @Slaporte, too!
SELECT rc_timestamp, rc_title, rc_user_text, rc_comment, rc_old_len, rc_new_len, rc_last_oldid, rc_this_oldid FROM recentchanges WHERE rc_type = 0 AND rc_timestamp < DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 DAY), '%m%d%H%i%s') AND rc_timestamp > DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 2 DAY), '%m%d%H%i%s') ORDER BY rc_timestamp ASC
{"resultsets": [{"headers": ["rc_timestamp", "rc_title", "rc_user_text", "rc_comment", "rc_old_len", "rc_new_len", "rc_last_oldid", "rc_this_oldid"], "rowcount": 0}]}
null
Oluremi Oyo
null
null
{"resultsets": []}
null
Wikidata - given names - en labels for missing nb labels
run time > 5 min
# For given names, set missing labels in language "nb" based on label in "en" (if available) # # See also https://upload.wikimedia.org/wikipedia/commons/f/f7/MediaWiki_1.24.1_database_schema.svg # use wikidatawiki_p; SELECT # output for Quickstatement tool CONCAT('Q', term_entity_id) AS item, "Lnb", # "Lnb" sets the label for the language with language code "nb" (change here and below) CONCAT('"', term_text, '"') As NewLabel, CURRENT_DATE from wb_terms WHERE term_entity_type = 'item' # 'item' not 'property' and term_type = 'label' # 'label', 'description', 'alias' and term_language in ('en') and term_entity_id IN ( SELECT epp_entity_id AS itemID # FROM pagelinks, page, wb_entity_per_page # LEFT JOIN ( SELECT term_entity_id FROM wb_terms WHERE term_entity_type = 'item' # 'item' not 'property' AND term_type = 'label' # 'label', 'description', 'alias' AND term_language in ('nb') # set language with missing labels here (sample with language code "nb" ) AS wbt ON epp_entity_id = wbt.term_entity_id WHERE wbt.term_entity_id IS NULL AND pl_from = 21293912 # id of page [[d:User:Jura1/first names/items (P31: ok, label: tbd)]] AND pl_namespace = 0 AND pl_title = page_title AND page_id = epp_page_id ) GROUP BY term_text, term_entity_id
{"resultsets": [{"headers": ["item", "Lnb", "NewLabel", "CURRENT_DATE"], "rowcount": 3384}]}
null
Featured article title,size,revisions of tewiki
null
use tewiki_p; SELECT page_title, page_len, count(*) AS num_of_revisions FROM revision LEFT JOIN page ON revision.rev_page=page.page_id WHERE page.page_namespace = 0 AND page_title in (SELECT page_title FROM page LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE (page_namespace=1 AND categorylinks.cl_to LIKE 'ఈ_వారం_వ్యాసాల_చర్చలు_-_Y%')) GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_title", "page_len", "num_of_revisions"], "rowcount": 395}]}
null
Top 1000 -Article Pages with most revisions(tewiki)
null
use tewiki_p; SELECT page_title, page_len, count(*) AS num_of_revisions FROM revision LEFT JOIN page ON revision.rev_page=page.page_id WHERE page_namespace=0 GROUP BY page_title ORDER BY page_title, num_of_revisions DESC LIMIT 1000
{"resultsets": [{"headers": ["page_title", "page_len", "num_of_revisions"], "rowcount": 1000}]}
null
Find commons pages unable to access templates after SUL user renames
Query by User:Bawolff. It finds pages which are using user namespace templates which were recently renamed (without redirects) by [[User:Keegan (WMF)]] as part of SUL finalization. See https://commons.wikimedia.org/wiki/Commons:Village_pump/Archive/2015/04#230k_SUL_user_renames_by_User:Maintenance_script for discussion
use commonswiki_p; select p1.page_namespace, p1.page_title, tl_title from templatelinks inner join page p1 on tl_from = p1.page_id -- p1 will transclude moved template left outer join page p2 on (p2.page_namespace = 2 -- user namespace template and p2.page_title = tl_title) inner join logging_logindex on log_namespace = 2 and log_title = tl_title and log_type = "move" -- user template was moved and log_params like "%~%" -- new user template name has a "~" where tl_namespace = 2 -- user namespace template and tl_from_namespace in ( 0, 1, 4, 6, 7) and p2.page_title is null;
{"resultsets": [{"headers": ["page_namespace", "page_title", "tl_title"], "rowcount": 14}]}
null
Pages incorrectly marked as GTP?
null
use tewiki_p; SELECT page_title FROM page LEFT JOIN revision ON rev_id = page_id LEFT JOIN user ON rev_user= user_id LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE page_namespace=0 AND page_is_redirect =0 AND categorylinks.cl_to = 'గూగుల్_అనువాద_వ్యాసాలు' AND (user_name NOT IN (SELECT page_title FROM page LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE (page_namespace=2 AND categorylinks.cl_to = 'యాంత్రిక_అనువాదాలు_చేసే_సభ్యులు'))) GROUP BY page_title ORDER BY page_title,user_name;
{"resultsets": [{"headers": ["page_title"], "rowcount": 893}]}
null
Wikidata tables
update http://quarry.wmflabs.org/query/739
use wikidatawiki_p; SHOW TABLES;
{"resultsets": [{"headers": ["Tables_in_wikidatawiki_p"], "rowcount": 66}]}
null
Some non-free files used in articles about people
Finds some non-free files which are used in at least one article about a living person. Non-free photos of living people usually violate [[WP:NFCC#1]]. Mostly finds paintings by living painters, so the query isn't very useful. Similar to http://quarry.wmflabs.org/query/2639 but returns file names instead of article titles and selects non-free files differently.
SELECT DISTINCT i.page_title FROM page a INNER JOIN categorylinks ca ON ca.cl_from = a.page_id AND ca.cl_to = 'Living_people' INNER JOIN imagelinks il ON il.il_from = a.page_id AND il.il_from_namespace = 0 INNER JOIN page i ON i.page_title = il.il_to AND i.page_namespace = 6 INNER JOIN categorylinks ci ON ci.cl_from = i.page_id AND ci.cl_to = 'Non-free_files_uploaded_as_object_of_commentary'
{"resultsets": [{"headers": ["page_title"], "rowcount": 277}]}
null
Wikimédia France - 2013-2014 round2 - Q3 - File usage
Usage of files supported by Wikimédia France during the Q3 of FDC year 2013-2014 round2
use commonswiki_p; SELECT COUNT(DISTINCT page_title) AS FilesUsed, COUNT(gil_wiki) AS Uses, COUNT(DISTINCT gil_wiki) AS NbWikis FROM page JOIN categorylinks JOIN globalimagelinks JOIN image ON image.img_name = page.page_title WHERE page.page_id=categorylinks.cl_from AND gil_to = page_title AND categorylinks.cl_to = "Media_supported_by_Wikimedia_France" AND img_timestamp BETWEEN 20150101000000 AND 20150401000000;
{"resultsets": [{"headers": ["FilesUsed", "Uses", "NbWikis"], "rowcount": 1}]}
null
Most frequent domains for dewiki
see Most frequent domains for itwiki_p https://quarry.wmflabs.org/query/2924
USE dewiki_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": ["url", "COUNT(*)"], "rowcount": 4924}]}
null
Daily Uploads @ WLE 2015
Used in https://tools.wmflabs.org/ptwikis/WLE2015
use commonswiki_p; SELECT SUBSTR(cl_to, 38) país, UNIX_TIMESTAMP(SUBSTR(img_timestamp, 1, 8)) dia, SUBSTR(img_timestamp, 1, 10) hora, COUNT(*) upload FROM categorylinks INNER JOIN page ON cl_from = page_id INNER JOIN image ON page_title = img_name AND img_timestamp < 20150801000000 WHERE cl_type = 'file' AND cl_to IN (SELECT page_title FROM page WHERE page_namespace = 14 AND page_title IN ('Images_from_Wiki_Loves_Earth_2015_in_Algeria','Images_from_Wiki_Loves_Earth_2015_in_Andorra_&_Catalan_areas','Images_from_Wiki_Loves_Earth_2015_in_Austria','Images_from_Wiki_Loves_Earth_2015_in_Azerbaijan','Images_from_Wiki_Loves_Earth_2015_in_Brazil','Images_from_Wiki_Loves_Earth_2015_in_Estonia','Images_from_Wiki_Loves_Earth_2015_in_France','Images_from_Wiki_Loves_Earth_2015_in_Germany','Images_from_Wiki_Loves_Earth_2015_in_Iraq','Images_from_Wiki_Loves_Earth_2015_in_Lebanon','Images_from_Wiki_Loves_Earth_2015_in_Macedonia','Images_from_Wiki_Loves_Earth_2015_in_Morocco','Images_from_Wiki_Loves_Earth_2015_in_Nepal','Images_from_Wiki_Loves_Earth_2015_in_Pakistan','Images_from_Wiki_Loves_Earth_2015_in_Palestine','Images_from_Wiki_Loves_Earth_2015_in_Poland','Images_from_Wiki_Loves_Earth_2015_in_Portugal','Images_from_Wiki_Loves_Earth_2015_in_Russia','Images_from_Wiki_Loves_Earth_2015_in_Spain','Images_from_Wiki_Loves_Earth_2015_in_Switzerland','Images_from_Wiki_Loves_Earth_2015_in_Syria','Images_from_Wiki_Loves_Earth_2015_in_Thailand','Images_from_Wiki_Loves_Earth_2015_in_Tunisia','Images_from_Wiki_Loves_Earth_2015_in_Ukraine','Images_from_Wiki_Loves_Earth_2015_in_Uruguay','Images_from_Wiki_Loves_Earth_2015_in_Serbia','Images_from_Wiki_Loves_Earth_2015_in_Hungary','Images_from_Wiki_Loves_Earth_2015_in_Australia','Images_from_Wiki_Loves_Earth_2015_in_Jordan') AND page_title NOT LIKE '%\_-\_%' ) GROUP BY país, hora
{"resultsets": [{"headers": ["pa\u00eds", "dia", "hora", "upload"], "rowcount": 2499}]}
null
Pages and first rev ts, number of rev for a set of wikipedians
Example uses category of wikipedians of Google Translation Project on tewiki
use tewiki_p; SELECT page_title, user_name, rev_timestamp as first_rev_timestamp, COUNT(*) as num_of_revisions FROM user LEFT JOIN revision ON rev_user = user_id LEFT JOIN page ON page_id = rev_page WHERE page_namespace=0 AND page_is_redirect =0 AND (user_name in (SELECT page_title FROM page LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE (page_namespace=2 AND categorylinks.cl_to = 'యాంత్రిక_అనువాదాలు_చేసే_సభ్యులు'))) GROUP BY page_title ORDER BY page_title,user_name;
{"resultsets": [{"headers": ["page_title", "user_name", "first_rev_timestamp", "num_of_revisions"], "rowcount": 1817}]}
null
Media supported by Wikimedia France by Months
null
USE commonswiki_p; SELECT /* SLOW_OK */ SUBSTRING(IF(oi_timestamp IS NULL, img_timestamp, oi_timestamp),1,6) AS upload_month, COUNT(page.page_title) AS images_count FROM image CROSS JOIN page ON image.img_name = page.page_title CROSS JOIN categorylinks ON page.page_id = categorylinks.cl_from LEFT JOIN oldimage ON image.img_name = oldimage.oi_name AND oldimage.oi_timestamp = (SELECT MIN(o.oi_timestamp) FROM oldimage o WHERE o.oi_name = image.img_name) WHERE categorylinks.cl_to = "Media_supported_by_Wikimedia_France" GROUP BY upload_month;
{"resultsets": [{"headers": ["upload_month", "images_count"], "rowcount": 96}]}
null
Lietotāji ar visvairāk labojumiem, kas nav automātiskie pārbaudītāji
Jāsalabo!
USE lvwiki_p; SELECT distinct u.user_name, u.user_editcount FROM user u where u.user_id not in (Select ug.ug_group from user_groups ug) ORDER BY u.user_editcount desc LIMIT 50;
{"resultsets": [{"headers": ["user_name", "user_editcount"], "rowcount": 50}]}
null
10 itwiki articles with the longest title
null
USE itwiki_p; SET @rank = 0; SELECT @rank := @rank + 1 AS rank, CHAR_LENGTH( page_title ) AS length, page_is_redirect AS redir, page_title AS title FROM page WHERE page_namespace = 0 ORDER BY length DESC LIMIT 10
{"resultsets": [{"headers": ["rank", "length", "redir", "title"], "rowcount": 10}]}
null
Modules on commons with wikitext page content
null
use commonswiki_p; SELECT page_namespace, page_title, page_content_model from page where page_namespace = 828 and page_title not like '%/doc' and page_content_model = 'wikitext'
{"resultsets": [{"headers": ["page_namespace", "page_title", "page_content_model"], "rowcount": 16}]}
null
Modules on commons with wikitext page content
A version of http://quarry.wmflabs.org/query/3610 that just shows the page_title field.
use commonswiki_p; SELECT page_title from page where page_namespace = 828 and page_title not like '%/doc' and page_content_model = 'wikitext'
{"resultsets": [{"headers": ["page_title"], "rowcount": 16}]}
null
Page title from page id of gtp
null
use tewiki_p; SELECT page_id,page_title FROM page WHERE page.page_namespace = 0 AND page_is_redirect =0 AND page_id in (108851,100930,103461,99712,104038,110859,102164,110730,102366,99339,106783,105609,110799,104575,111458,107725,109356,107219,100834,101148,112131,97471,102140,110751,104917,107286,100332,108991,101992,110971,105085,103890,108043,108945,110979,102251,108893,108327,98898,107176,100812,105969,111080,10572,102119,105971,105022,100980,105252,40368,111298,112545,110105,105007,107260,110816,106110,111389,105974,101752,105795,104895,104110,106475,106574,108146,105878,110787,108023,110763,107402,105920,107915,96806,111967,111853,89309,111042,111570,105970,106061,106225,111405,110212,109659,112725,108009,108550,102812,109797,106047,106448,105998,103889,106040,106112,106046,106793,108608,106107,112985,106203,109859,102389,106190,104937,108024,110278,104042,105562,106109,105973,108852,108440,106240,105240,112154,105509,106185,105322,104945,106989,111409,105968,103157,102004,110210,108892,104487,105652,105717,112771,108413,109145,1149,111467,111571,94503,105708,107119,102121,110723,106797,102961,103476,100747,82054,110356,110989,110815,105337,111183,106045,105807,105712,105964,104574,103048,112635,74656,108736,108839,93097,110755,105410,109493,108148,104228,105157,112240,103900,111581,110727,111574,110041,99653,100748,110931,100125,111286,110174,111192,107875,108937,108607,102162,111077,110840,106769,106713,100744,108490,111417,104993,105578,108822,105776,106845,109130,112218,111362,108315,110308,110764,110846,102650,105777,111455,108592,108374,107005,106011,108199,112777,112624,102367,102806,107867,82346,107257,107037,75427,105404,107401,111287,108248,107285,110079,111360,104114,110728,113370,105835,106113,106186,105965,105966,108834,103892,102391,56106,105921,110416,108392,106616,108772,105682,103998,108904,100033,104964,105030,105285,105820,107007,108611,112400,105824,102007,102486,110661,102730,109110,108445,105602,105922,69783,108844,103637,104164,106086,110736,103919,112881,111249,109694,108198,108612,102876,106111,106042,100032,105511,111528,102044,110820,106925,104920,104159,100473,105009,101756,108243,108491,109218,111406,108601,105230,106659,111583,61459,106085,72868,110515,108264,104092,110470,108946,99676,75306,100124,106678,103104,101685,180268,110127,9841,109221,105505,106774,103046,108859,106773,103450,109798,106405,111052,102242,106287,102020,111140,111623,109719,110285,112936,105179,108330,106716,113411,101576,106443,108183,108000,111285,108249,112984,110068,104126,106693,100814,105092,104626,100059,106422,103339,67167,61844,106263,106230,109516,106231,102801,105510,102981,105383,111749,104965,112908,109150,102808,111060,106715,113041,106991,106694,111707,108328,106714,107868,99338,104413,106660,75439,111543,109712,111511,72786,109464,102017,112970,105653,103462,108886,113130,113401,106241,100031,102542,104936,105918,102038,109036,102512,1888,108182,96066,112982,103638,108884,106421,109466,101392,106705,106403,105711,102018,103835,105604,112935,110789,106711,111496,104306,102851,108992,106629,110760,101390,108990,112888,106829,101066,101753,110964,106360,100627,112773,113061,110943,111252,111254,111226,111539,106710,105558,106573,111363,106445,106444,111041,111748,106708,108572,108836,102877,110344,112392,113462,106427,98772,108364,110819,105001,110810,111471,105812,101751,102165,111372,99982,110957,108791,106267,111580,110516,110509,110863,112954,102214,102625,107357,111017,110534,111544,106998,110576,102365,106418,108837,110129,106250,103894,113042,100820,11820,2403,111476,100456,107805,111444,108774,110935,106994,107130,109687,105091,108181,104169,100470,106187,107043,105655,108944,111769,109013,105307,110497,104899,108803,104106,105796,108796,103156,104307,108970,105045,98621,107168,104037,105460,102511,110547,112899,110417,102538,108389,106236,106188,108821,100126,103456,110726,108773,106189,112897,106446,106490,112860,105779,107877,104994,92453,106424,106550,106425,113410,106404,107284,106222,84935,101589,113312,106043,106066,105697,105557,105886,103158,106789,106712,106782,107911,109223,112402,100631,100704,101575,108921,108252,109683,108025,53283,111403,100475,108540,104898,105166,109949,99026,106249,112823,103458,101067,106984,106765,102240,93494,110433,105087,112937,104995,112977,111105,105587,109636,104091,105778,108245,111516,105556,105255,103696,105306,101481,108301,110821,102008,105242,97999,106201,99344,105155,106787,99911,56358,102871,102870,106625,98785,99360,106652,111366,111472,108899,104477,110425,106788,106791,102006,100043,110536,102163,102539,111566,105670,102541,106844,103997,106692,105508,111083,103620,108016,106361,97990,102852,100285,107905,110526,111247,109162,113297,103452,102122,78186,105138,68206,105305,100042,99957,105651,107584,112861,109197,105047,108865,107726,109656,107587,104583,103457,111194,91275,111466,111461,109796,107443,107442,112955,112231,104235,111436,107724,107952,105794,107318,113180,106202,107400,107406,100837,108014,102120,106552,110912,110766,107001,105323,110170,108919,104919,112109,106762,99983,106775,111062,104161,104653,106617,106921,109879,106620,105304,112926,107003,106855,110911,100123,103832,106577,106622,111273,106854,102362,110761,106555,105464,105823,106612,106613,106556,106557,100044,103460,106648,106531,106581,99314,106532,109645,113110,111274,106657,103831,104961,102019,105303,111127,106578,103834,111508,106551,102009,108879,107459,107289,64952,105654,105608,108617,112971,105707,111460,101095,104625,102540,107777,103695,110639,107258,98645,110825,110159,100030,107125,107441,107758,108860,102807,107011,105657,110128,105235,100740,104402,101852,104582,110514,112867,111862,106530,109644,106649,110862,106358,110907,105358,111347,103693,105834,104359,107514,105923,99954,101142,104924,108394,103639,111364,104576,104990,105877,106083,112951,108123,107006,106704,108265,108246,110505,109800,101842,112772,107727,106796,102141,106676,103455,107967,79482,110220,111069,108124,77205,97989,108591,89486,65244,111419,106103,104627,102487,109164,107407,105114,108029,106395,111359,104305,69131,103897,106093,107824,105603,105343,102802,103106,108584,112239,110523,109189,109166,104922,111068,108028,110700,109787,108881,104962,110216,99655,72947,109795,111124,105228,102853,106618,102139,100727,108500,110168,98650,107512,104116,101393,109794,107783,104585,105710,110201,101273,104163,110631,107775,107440,110583,99036,107782,110166,110750,110959,105975,110590,105713,112866,110797,104940,99539,107118,107033,106987,102854,107013,113026,105178,101895,110811,108299,108022,104227,108731,110045,110167,107028,107029,107068,105891,99909,101672,112880,106062,109718,107912,109032,113111,109765,105504,109217,110208,108141,105656,105829,109219,112249,110923,98643,111404,101590,112127,108923,100463,110918,109228,108984,109151,107513,104162,108340,113602,106761,110529,103105,100274,111995,109057,109647,104165,105028,105321,107145,100155,104996,104546,105605,109699,109138,111768,108242,101070,107256,105673,109156,105555,110550,108262,106102,108143,102516,105553,110725,111138,77062,112989,109642,108863,108579,13260,67849,59126,106992,108733,107071,110507,110479,98616,112361,108051,107177,110551,107146,111051,102682,101329,102252,108190,107399,109152,105142,110172,107180,107181,107144,105086,102005,108567,110469,109661,98897,105320,104939,112770,108266,108052,100813,107030,100214,108192,99975,110733,111509,108623,100045,101271,35677,108116,106988,112364,102875,105342,102489,98618,85599,109684,102514,109242,111780,99479,104036,111438,45247,100074,107017,108499,105267,107027,109682,108735,107178,108451,112901,112389,103793,108379,107781,111480,106996,101767,104573,107179,106997,111541,112815,108917,112887,105411,109165,104107,110512,105590,110978,111004,108862,110142,104963,111663,103635,103454,110043,104501,47017,103891,112909,100284,102118,110207,105769,113492,107223,112843,104113,110756,106429,110841,110845,106426,113487,108858,101144,70019,105662,110075,108897,108168,108226,106265,102363,99302,106264,105715,106048,108578,111573,112497,105107,105822,68426,102040,109019,104167,106108,108329,110498,103833,99884,106909,112118,100840,104921,108885,105340,105658,112232,102535,106436,101145,106347,106044,112365,111960,108415,106363,112217,105714,112546,108381,102492,110581,108053,107069,110885,102161,102962,106184,106233,109638,67122,84559,112230,106229,111271,105879,109665,110202,82687,106260,111196,106908,108590,99970,105046,106194,99914,110772,112822,103908,100333,101755,105268,110605,110054,99341,105833,111410,111121,105836,111679,102041,112940,103321,111139,105606,102488,106407,103365,106423,106794,106420,102046,112668,106238,106995,102814,111275,106624,106357,99340,105241,106653,106437,106920,106242,106626,107016,110814,108187,110828,110942,112938,111357,98961,111053,106767,105462,108541,100741,106952,108625,108033,108737,108359,109860,110211,100629,101272,110790,105426,93212,113616,100750,110530,97992,98619,109184,103047,99654,34672,107873,106351,112775,105586,112824,104142,104115,95817,111370,109691,106917,108849,108117,112825,105832,82007,107803,103470,106986,110930,104308,101147,108197,107008,102253,112155,105780,105336,108614,112846,112260,105671,103907,100819,110769,113054,79316,111251,106927,105139,99480,109133,104891,105103,108883,108577,109695,109790,99675,99650,112844,111787,108818,112319,109630,103235,106926,106942,106951,105607,107560,103837,112387,103792,105809,112732,112956,106904,106868,106869,111128,108987,108202,107837,105141,113095,104572,105963,108999,105136,108042,108285,96796,108021,106866,106918,35210,107220,100835,110994,110629,108570,112986,108362,111927,110548,107958,102254,110040,111143,111145,108208,106215,103893,107823,107222,106905,104925,108867,112845,107822,102872,106867,102213,98617,111106,104548,105806,105409,111569,108456,110524,105919,106865,112854,107776,108626,109198,109690,101574,109059,109100,109058,110779,83848,110643,101851,102043,110951,109163,103322,105716,104304,99971,108284,98773,108580,111540,106882,111065,110904,73115,107042,105112,108853,111973,103830,106088,112927,110465,105284,110283,99649,110731,111054,107221,99651,107355,111462,100334,100156,105339,108495,108298,107964,104476,108497,110860,109515,107760,108356,108568,111016,110735,109051,103896,109799,107405,101994,105589,104944,112420,112885,111123,111387,109066,111250,106786,102217,106489,105992,104338,108496,107293,109387,109733,112488,108171,107218,109134,92785,104090,108838,112895,111290,102241,111469,108624,109429,82891,110074,101143,102805,108233,105681,109669,108026,102490,107585,103471,102815,102491,108804,109426,103836,107123,108569,111567,104105,108205,99652,111075,97039,108616,101754,111433,109648,113369,111081,110788,102513,110464,102045,108144,108363,104415,112304,107320,105338,100630,106792,106880,78797,102510,105229,108939,110936,109698,60284,104918,105266,102255,111118,110929,109525,106798,111379,105357,105008,105818,110765,112108,106089,107876,104894,110552,103459,109067,109637,104547,106766,111394,110785,106843,101069,110701,111434,112886,107878,110843,112403,110890,74788,74789,108618,98708,98994,106200,109641,107070,107259,110826,111269,105029,107336,108903,108539,102850,106428,109188,91255,112911,109716,113583,107757,99334,105821,109940,111575,109514,110169,105435,109766,103453,111297,102321,108619,108613,108843,108172,113187,107457,106614,107319,98833,72463,111253,73208,97069,111061,101094,108615,113161,109425,108203,110977,108890,104556,110950,111013,103496,110944,103905,105967,111591,109468,112244,111840,111841,102982,108854,103451,112862,107287,102515,108585,108253,106916,112634,108244,107404,108877,100157,113490,108120,109187,110171,111401,101484,111510,102138,110827,109355,98834,108498,112078,111270,110762,108296,90934,103636,103888,108314,110510,110132,108850,106907,113181,100745,103694,101588,111579,109031,104992,110699,108464,99910,104094,105644,111722,100838,98962,105006,111010,110854,112401,107040,107059,74338,98653,107009,113374,105089,107746,107035,107103,105113,111464,106661,99958,110503,106020,110990,107836,111074,107032,107034,104401,107041,109938,99986,107121,103902,106862,112884,104558,108355,108250,107120,107122,110549,107036,110914,94502,111420,105387,102016,105331,112320,110206,111524,99956,102215,106406,109234,105771,100628,97988,103918,80705,107066,108868,110062,106785,101391,112865,108996,111195,107744,111082,112507,109204,108125,107124,105386,108354,108866,110884,100815,105243,102166,98965,104166,105893,111435,110734,108193,110076,105554,102873,109037,112719,108894,109685,111279,110203,109062,108147,105385,83201,96847,110724,109643,98651,107038,100474,110219,104557,109939,112421,107039,110156,108997,59579,111089,102811,113341,110218,105309,100979,103463,102878,110091,110078,110044,99342,106784,108938,106476,106064,105999,111463,108204,106760,106266,110963,110780,108998,103159,106554,109886,102239,110205,106820,111283,112727,85712,110215,105425,101146,111459,108438,112896,107458,102123,105819,109944,98644,111457,110662,107288,111104,107589,100836,98784,105423,83321,108936,111122,111549,106795,109465,102651,113051,110537,106830,108918,105512,40147,107014,104938,105857,108809,106013,101592,105858,103049,110538,105645,107102,109697,109784,110961,105254,107129,106582,107171,110164,111281,103464,105344,106204,110949,100029,104628,106881,108015,102136,106091,105237,102809,113027,105341,112776,112622,110546,105332,105595,107058,100034,103469,105402,105449,107762,104545,91297,108561,110905,97916,109783,110354,99343,103640,105140,102238,112216,110525,105317,102390,99908,108251,107759,3730,106772,104486,109000,108895,104437,102216,111448,110966,104414,99648,105872,109029,110745,111301,111055,99985,110970,102322,110209,109686,108995,105403,111568,111576,111142,108484,104923,109518,105978,110158,110922,101411,105695,106129,106771,110053,63338,101993,108880,106901,111407,111371,111393,100746,111408,109646,68548,111365,111386,102042 ) ORDER BY page_id
{"resultsets": [{"headers": ["page_id", "page_title"], "rowcount": 1989}]}
null
First itwiki edits of 2015 (CEST)
null
USE itwiki_p; SELECT rev_timestamp, rev_id, rev_user_text FROM revision WHERE SUBSTRING( rev_timestamp, 1, 12 ) = '201412312300' ORDER BY rev_timestamp ASC LIMIT 10
{"resultsets": [{"headers": ["rev_timestamp", "rev_id", "rev_user_text"], "rowcount": 10}]}
null
Article pages starting with English alphabets -redirects
null
use tewiki_p; SELECT page_id,page_title, rd_title FROM page LEFT JOIN redirect ON rd_from=page.page_id WHERE page_namespace=0 AND page_is_redirect=1 AND LENGTH(page_title)=CHAR_LENGTH(page_title) AND page_title REGEXP "^[a-z|A-Z]+" GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_id", "page_title", "rd_title"], "rowcount": 1487}]}
null
Pages translated using Google Translate-hiwiki
Includes annonymous upload by project members and experimental translation by others(?)
use hiwiki_p; SELECT page_id, rev_parent_id, rev_len, rev_id, user_id, user_name, rev_timestamp, rev_comment, page_title FROM revision LEFT JOIN page ON revision.rev_page=page.page_id LEFT JOIN user ON rev_user = user_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND rev_comment LIKE "%toolkit%" GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_id", "rev_parent_id", "rev_len", "rev_id", "user_id", "user_name", "rev_timestamp", "rev_comment", "page_title"], "rowcount": 2321}]}
null
Pages translated using Google Translate-tawiki
null
use tawiki_p; SELECT page_id, rev_parent_id, rev_len, rev_id, user_id, user_name, rev_timestamp, rev_comment, page_title FROM revision LEFT JOIN page ON revision.rev_page=page.page_id LEFT JOIN user ON rev_user = user_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND rev_comment LIKE "%toolkit%" GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_id", "rev_parent_id", "rev_len", "rev_id", "user_id", "user_name", "rev_timestamp", "rev_comment", "page_title"], "rowcount": 1290}]}
null
Pages translated using Google Translate-knwiki
null
use knwiki_p; SELECT page_id, rev_parent_id, rev_len, rev_id, user_id, user_name, rev_timestamp, rev_comment, page_title FROM revision LEFT JOIN page ON revision.rev_page=page.page_id LEFT JOIN user ON rev_user = user_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND rev_comment LIKE "%toolkit%" GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_id", "rev_parent_id", "rev_len", "rev_id", "user_id", "user_name", "rev_timestamp", "rev_comment", "page_title"], "rowcount": 2204}]}
null
Pages translated using Google Translate-bnwiki
null
use bnwiki_p; SELECT page_id, rev_parent_id, rev_len, rev_id, user_id, user_name, rev_timestamp, rev_comment, page_title FROM revision LEFT JOIN page ON revision.rev_page=page.page_id LEFT JOIN user ON rev_user = user_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND rev_comment LIKE "%toolkit%" GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_id", "rev_parent_id", "rev_len", "rev_id", "user_id", "user_name", "rev_timestamp", "rev_comment", "page_title"], "rowcount": 48}]}
null
File usage of Geograph images
null
use commonswiki_p; SELECT COUNT(DISTINCT page_title) AS FilesUsed, COUNT(gil_wiki) AS Uses, COUNT(DISTINCT gil_wiki) AS NbWikis FROM page JOIN categorylinks JOIN globalimagelinks JOIN image ON image.img_name = page.page_title WHERE page.page_id=categorylinks.cl_from AND gil_to = page_title AND categorylinks.cl_to = "Images_from_the_Geograph_British_Isles_project";
{"resultsets": [{"headers": ["FilesUsed", "Uses", "NbWikis"], "rowcount": 1}]}
null
Fork of #3623
null
#1 SELECT DISTINCT rev_user_text, rev_user, cl_to #2 FROM commonswiki_p.page p #3 INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from #4 INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page #5 WHERE p.page_namespace = 6 #6 AND cl.cl_to IN ("Images_from_the_Geograph_British_Isles_project") #7 AND r.rev_parent_id = 0;
{"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 917}]}
null
Wikimédia France - 2013-2014 round2 - Q3 - File count
Count of files supported by Wikimédia France during the Q3 of FDC year 2013-2014 round2
use commonswiki_p; SELECT COUNT(page_title) FROM image, page, categorylinks WHERE page.page_id=categorylinks.cl_from AND image.img_name = page.page_title AND .categorylinks.cl_to = "Quality_images_supported_by_Wikimedia_France" AND img_timestamp BETWEEN 20150101000000 AND 20150401000000;
{"resultsets": [{"headers": ["COUNT(page_title)"], "rowcount": 1}]}
null
Wikimédia France - 2013-2014 round2 - Q3 - QIs
List of files supported by Wikimédia France and identified as Quality Images during the Q3 of FDC year 2013-2014 round2
use commonswiki_p; SELECT page_title, img_user_text AS uploader FROM page JOIN categorylinks AS cl1 ON page_id=cl1.cl_from JOIN categorylinks AS cl2 ON page_id=cl2.cl_from JOIN image ON image.img_name = page.page_title WHERE cl1.cl_to="Media_supported_by_Wikimedia_France" AND cl2.cl_to="Quality_images" AND img_timestamp BETWEEN 20150101000000 AND 20150401000000 ORDER BY uploader DESC;
{"resultsets": [{"headers": ["page_title", "uploader"], "rowcount": 37}]}
null
Wikimédia France - 2013-2014 round2 - Q3 - VIs
List of files supported by Wikimédia France and identified as Valued Images during the Q3 of FDC year 2013-2014 round2
use commonswiki_p; SELECT page_title, img_user_text AS uploader FROM page JOIN categorylinks AS cl1 ON page_id=cl1.cl_from JOIN categorylinks AS cl2 ON page_id=cl2.cl_from JOIN image ON image.img_name = page.page_title WHERE cl1.cl_to="Media_supported_by_Wikimedia_France" AND cl2.cl_to="Valued_images_sorted_by_promotion_date" AND img_timestamp BETWEEN 20150101000000 AND 20150401000000 ORDER BY uploader DESC;
{"resultsets": [{"headers": ["page_title", "uploader"], "rowcount": 89}]}
null
Pages created by list of users and list of links
null
SELECT DISTINCT page_id AS pages_created FROM metawiki_p.page AS p INNER JOIN metawiki_p.revision AS r ON r.rev_page = p.page_id JOIN metawiki_p.pagelinks AS pl ON p.page_title = pl.pl_title WHERE p.page_namespace = 2 AND p.page_id = 3404236 AND r.rev_user_text LIKE ("EGalvez_(WMF)") AND r.rev_parent_id = 0 AND r.rev_timestamp > 20130701000000 AND r.rev_timestamp < 20140201000000 ;
{"resultsets": [{"headers": ["pages_created"], "rowcount": 1}]}
null
Hewiki pictures many
null
use hewiki_p; select page_namespace as "מרחב שם", page_title as "קובץ" from categorylinks as cl1 join page as p1 on (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 cl_from = page_id and page_namespace = 6 and exists (select * from imagelinks as il1 where il_to = page_title and exists (select * from imagelinks as il2 where il2.il_to = page_title and il1.il_from != il2.il_from));
{"resultsets": [{"headers": ["\u05de\u05e8\u05d7\u05d1 \u05e9\u05dd", "\u05e7\u05d5\u05d1\u05e5"], "rowcount": 2427}]}
null
Number of edited pages in enwiki since 2015.05.17
null
select count(page_title) from enwiki_p.page where page_touched > 20150517000000;
{"resultsets": [{"headers": ["count(page_title)"], "rowcount": 1}]}
null
Number of pages edited on 2015.05.17 in enwiki
null
SELECT COUNT(page_title) FROM enwiki_p.page WHERE (page_touched >= 20150517000000) AND (page_touched < 20150518000000);
{"resultsets": [{"headers": ["COUNT(page_title)"], "rowcount": 1}]}
null
Empty categories in enwiki
Query from https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Shared_Resources/MySQL_queries#Empty_categories
SELECT page_title, page_len FROM categorylinks RIGHT JOIN page ON cl_to = page_title WHERE page_namespace = 14 AND page_is_redirect = 0 AND cl_to IS NULL AND NOT EXISTS (SELECT 1 FROM categorylinks WHERE cl_from = page_id AND cl_to = 'Wikipedia_category_redirects') AND NOT EXISTS (SELECT 1 FROM categorylinks WHERE cl_from = page_id AND cl_to = 'Disambiguation_categories') AND NOT EXISTS (SELECT 1 FROM templatelinks WHERE tl_from = page_id AND tl_namespace = 10 AND tl_title = 'Empty_category');
{"resultsets": [{"headers": ["page_title", "page_len"], "rowcount": 39829}]}
null
Lvwiki articles with the longest title
From http://quarry.wmflabs.org/query/3603
USE lvwiki_p; SET @rank = 0; SELECT @rank := @rank + 1 AS rank, CHAR_LENGTH( page_title ) AS length, page_title AS title FROM page WHERE page_namespace = 0 and page_is_redirect=0 and page_title not like "%Olimpiskajās_spēlēs%" ORDER BY length DESC LIMIT 50 /* oriģināls USE lvwiki_p; SET @rank = 0; SELECT @rank := @rank + 1 AS rank, CHAR_LENGTH( page_title ) AS length, page_is_redirect AS redir, page_title AS title FROM page WHERE page_namespace = 0 ORDER BY length DESC LIMIT 100 */
{"resultsets": [{"headers": ["rank", "length", "title"], "rowcount": 50}]}
null
WLE 2015 in Estonia uploads
null
use commonswiki_p; SELECT SUBSTR(cl_to, 38) country, SUBSTR(img_timestamp, 1, 8) day, COUNT(*) upload FROM categorylinks INNER JOIN page ON cl_from = page_id INNER JOIN image ON page_title = img_name AND img_timestamp < 20150801000000 WHERE cl_type = 'file' AND cl_to IN (SELECT page_title FROM page WHERE page_namespace = 14 AND page_title IN ('Images_from_Wiki_Loves_Earth_2015_in_Estonia') AND page_title NOT LIKE '%\_-\_%' ) GROUP BY country, day
{"resultsets": [{"headers": ["country", "day", "upload"], "rowcount": 15}]}
null
SHOW TABLE STATUS on revision didn't show any info
I've been trying to get the total number of rows and was hoping that TABLE STATUS would do the trick.
USE enwiki_p; SHOW TABLE STATUS FROM enwiki_p LIKE 'revision';
{"resultsets": [{"headers": ["Name", "Engine", "Version", "Row_format", "Rows", "Avg_row_length", "Data_length", "Max_data_length", "Index_length", "Data_free", "Auto_increment", "Create_time", "Update_time", "Check_time", "Collation", "Checksum", "Create_options", "Comment"], "rowcount": 1}]}
null
Most edited pages in the last month
From https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Shared_Resources/MySQL_queries#Most_edited_pages_in_last_month This query runs fairly fast.
use enwiki_p; SELECT rc_title, COUNT(*) AS num_edits FROM recentchanges WHERE rc_namespace = 0 GROUP BY 1 ORDER BY 2 DESC LIMIT 25;
{"resultsets": [{"headers": ["rc_title", "num_edits"], "rowcount": 25}]}
null
Revision timestamp and length for Johann_Sebastian_Bach in enwiki
null
select rev_id, rev_timestamp, rev_len from revision where rev_page = 9906294 ORDER BY rev_timestamp ASC;
{"resultsets": [{"headers": ["rev_id", "rev_timestamp", "rev_len"], "rowcount": 5675}]}
null
Last registered users
null
USE enwiki_p; SELECT u.user_id, u.user_name, u.user_registration, u.user_editcount FROM user u ORDER BY u.user_id DESC LIMIT 10;
{"resultsets": [{"headers": ["user_id", "user_name", "user_registration", "user_editcount"], "rowcount": 10}]}
null
possible values for user_properties.up_property
null
USE enwiki_p; SELECT DISTINCT(up_property) FROM user_properties;
{"resultsets": [{"headers": ["up_property"], "rowcount": 8}]}
null
user_properties for a specified user_name
null
SET @user_name = 'RaymondYee'; USE enwiki_p; SELECT u.user_id, u.user_name, u.user_registration, u.user_editcount, up.up_property, up.up_value FROM user u LEFT JOIN user_properties up ON u.user_id = up.up_user WHERE u.user_name = @user_name
{"resultsets": [{"headers": ["user_id", "user_name", "user_registration", "user_editcount", "up_property", "up_value"], "rowcount": 2}]}
null
distinct namespaces in enwiki pages.
Interesting to match up with the annotated list in the infobox at https://en.wikipedia.org/wiki/Wikipedia:Namespace
USE enwiki_p; SELECT DISTINCT(page_namespace) FROM page;
{"resultsets": [{"headers": ["page_namespace"], "rowcount": 28}]}
null
use site_stats to get overall stats for a wiki
null
USE enwiki_p; SELECT * FROM site_stats;
{"resultsets": [{"headers": ["ss_row_id", "ss_total_views", "ss_total_edits", "ss_good_articles", "ss_total_pages", "ss_users", "ss_images", "ss_active_users"], "rowcount": 1}]}
null
Every WikiProject on English Wikipedia (excluding task forces)
In which James Hare attempts to craft a formal definition of the WikiProject, not including task forces that are subpages of other pages.
select distinct page.page_title from page join categorylinks on page.page_id = categorylinks.cl_from left join redirect on page.page_id = redirect.rd_from where page_namespace = 4 # Wikipedia namespace and page_title not like "%/%" # No subpages and rd_title is null # No redirects and (cl_to in (select page.page_title from page where page_namespace = 14 # Categories and page_title like "%\_WikiProjects" and page_title not like "%\_for\_WikiProjects" and page_title not like "%\_of\_WikiProjects") # Pages sorted in a WikiProject "meta categories" or page_title like "WikiProject\_%" # Pages named "WikiProject (something)" even if they are not in one of the categories );
{"resultsets": [{"headers": ["page_title"], "rowcount": 1966}]}
null
user groups and their count in enwiki
null
SELECT ug_group, COUNT(ug_group) FROM user_groups GROUP BY ug_group;
{"resultsets": [{"headers": ["ug_group", "COUNT(ug_group)"], "rowcount": 27}]}
null
Examples of data in wikidatawiki_p.wb_changes
null
USE wikidatawiki_p; SELECT * FROM wb_changes LIMIT 10
{"resultsets": [{"headers": ["change_id", "change_type", "change_time", "change_object_id", "change_revision_id", "change_user_id", "change_info"], "rowcount": 10}]}
null
term_text for Albany, California in wikidata
null
USE wikidatawiki_p; SELECT * FROM wb_terms WHERE term_entity_id = '671480' # Albany,_California
{"resultsets": [{"headers": ["term_row_id", "term_entity_id", "term_entity_type", "term_language", "term_type", "term_text", "term_search_key", "term_weight"], "rowcount": 45}]}
null
Wikidata - given names - en labels
null
# list of given name items linked from page [[User:Jura1/first names/items (P31: ok, label: tbd)]] # use wikidatawiki_p; # SELECT page_title AS item, term_type, term_language, term_text, page_title AS item1, CONCAT('L', term_language) AS Desc1, CONCAT('"', term_text , '"') AS Str1 # FROM pagelinks, page, wb_entity_per_page, wb_terms # WHERE pl_from = 21293912 # id of page [[d:User:Jura1/first names/items (P31: ok, label: tbd)]] AND pl_namespace = 0 AND pl_title = page_title AND page_id = epp_page_id AND epp_entity_id = term_entity_id AND term_entity_type = 'item' # 'item' not 'property' AND term_type = 'label' # 'label', 'description', 'alias' AND term_language in ('en') # # alternate "term_language" for main languages with Roman script # AND term_language IN ('en','de','fr','it','es','af','an','ast','bar','br','ca','co','cs','cy','da', 'de-at','de-ch','en-ca','en-gb','eo','et','eu','fi','frp','fur','ga','gd','gl','gsw','hr','hu','ia','id','ie','is','io','kg','lb','li','lij','mg','min','ms', 'nap','nb','nds','nds-nl','nl','nn','nrm','oc','pcd','pl','pms','pt','pt-br', 'rm','ro','sc','scn','sco','sk','sl','sr-el','sv','sw','vec','vi','vls','vo','wa','wo','zu')
{"resultsets": [{"headers": ["item", "term_type", "term_language", "term_text", "item1", "Desc1", "Str1"], "rowcount": 16488}]}
null
Links to mobile
Sample of 100 links to mobile version sites.
use hewiki_p; select substr(el_to, 1,locate('/',el_to, 9)), count(*) from externallinks where el_to like '%://m.%/%' group by substr(el_to, 1,locate('/',el_to, 9)) order by count(*) desc;
{"resultsets": [{"headers": ["substr(el_to, 1,locate('/',el_to, 9))", "count(*)"], "rowcount": 71}]}
null
Missing wikiquote backlinks on plwiktionary
null
SELECT wiktpage.page_id AS wikt_id, qpage.page_title AS quote_title FROM plwikiquote_p.page AS qpage JOIN plwiktionary_p.page AS wiktpage ON CONCAT(UPPER(LEFT(wiktpage.page_title, 1)), SUBSTRING(wiktpage.page_title, 2)) = qpage.page_title AND wiktpage.page_namespace = qpage.page_namespace AND wiktpage.page_is_redirect = qpage.page_is_redirect WHERE qpage.page_namespace = 0 AND qpage.page_is_redirect = 0 AND NOT EXISTS ( SELECT NULL FROM plwikiquote_p.page_props AS qpprops WHERE qpprops.pp_propname = "disambiguation" AND qpprops.pp_page = qpage.page_id ) AND NOT EXISTS( SELECT NULL FROM plwiktionary_p.iwlinks AS wiktiwlinks WHERE wiktiwlinks.iwl_title = qpage.page_title ) AND EXISTS ( SELECT NULL FROM plwiktionary_p.categorylinks AS wiktclinks WHERE wiktclinks.cl_to = "polski_(indeks)" AND wiktclinks.cl_from = wiktpage.page_id ) GROUP BY quote_title;
{"resultsets": [{"headers": ["wikt_id", "quote_title"], "rowcount": 116}]}
null
Pixels supported by Wikimedia France
null
USE commonswiki_p; SELECT /* SLOW_OK */ FORMAT(COUNT(image.img_name), 3) AS 'image_count', FORMAT(SUM(image.img_width*image.img_height), 3) AS 'sum_pixel', FORMAT(SUM(image.img_width*image.img_height)/COUNT(image.img_name), 3) AS 'pixels_per_img' FROM image CROSS JOIN page ON image.img_name = page.page_title CROSS JOIN categorylinks ON page.page_id = categorylinks.cl_from WHERE categorylinks.cl_to = "Media_supported_by_Wikimedia_France";
{"resultsets": [{"headers": ["image_count", "sum_pixel", "pixels_per_img"], "rowcount": 1}]}
null
Wikidata - given names - sitelink ct
null
# Sitelinks per given name item linked from page [[User:Jura1/first names/items (P31: ok, label: tbd)]] # # See also https://upload.wikimedia.org/wikipedia/commons/f/f7/MediaWiki_1.24.1_database_schema.svg # use wikidatawiki_p; # SELECT page_title AS item, term_type, term_language, term_text, CONCAT('<tr><td> [[', page_title, '|', term_text, ']] <td>', COUNT(ips_site_id) ) As table_output_in_one_cell, COUNT(ips_site_id) As freq, CURRENT_DATE # FROM pagelinks As pl1, page, wb_entity_per_page, wb_terms, wb_items_per_site # WHERE pl1.pl_from = 21293912 # id of page [[d:User:Jura1/first names/items (P31: ok, label: tbd)]] #WHERE pl1.pl_from = 21607563 # id of page [[d:User:Jura1/first names/items (P31: not ok)]] AND pl1.pl_namespace = 0 AND pl1.pl_title = page_title AND page_id = epp_page_id AND epp_entity_id = term_entity_id AND term_entity_type = 'item' # 'item' not 'property' AND term_type = 'label' # 'label', 'description', 'alias' AND term_language in ('en') AND term_entity_id = ips_item_id GROUP BY pl1.pl_title HAVING pl_title <> 'Q211024' #exclude this one ;) AND COUNT(ips_site_id) > 4 #display only if more than 4
{"resultsets": [{"headers": ["item", "term_type", "term_language", "term_text", "table_output_in_one_cell", "freq", "CURRENT_DATE"], "rowcount": 1464}]}
null
Page title, size,revisions of articles for Google Translation Project
change categorylinks.clto= for the category you need
use tewiki_p; SELECT page_title, page_len, count(*) AS num_of_revisions FROM revision LEFT JOIN page ON revision.rev_page=page.page_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND page_title in (SELECT page_title FROM page LEFT JOIN categorylinks ON categorylinks.cl_from = page.page_id WHERE (page_namespace=0 AND page_is_redirect =0 AND categorylinks.cl_to LIKE 'గూగుల్_అనువాద_వ్యాసాలు%')) GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_title", "page_len", "num_of_revisions"], "rowcount": 2027}]}
null