title
stringlengths
1
212
description
stringlengths
1
4.39k
query
stringlengths
1
65.5k
extra_info
stringlengths
18
31.6k
wikidb
stringlengths
4
26
Pages translated using Google Translate-tewiki
null
use tewiki_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": 1991}]}
null
All pages in enwiki with title of Johann_Sebastian_Bach
One thing I did not appreciate before issuing this query: the use of page_namespace. Question: how to get a list of namespaces? Answer: https://meta.wikimedia.org/wiki/Meta:Namespaces
USE enwiki_p; SELECT * FROM page WHERE page_title = "Johann_Sebastian_Bach";
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model"], "rowcount": 8}]}
null
20000 revisions from frwiki for revscores
null
USE frwiki_p; SELECT rc_this_oldid AS rev_id, rc_cur_id AS page_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", "page_id"], "rowcount": 20000}]}
null
get user data for username
get user data of user by username
use dewiki_p; SELECT * FROM user WHERE user_name = "Fanim";
{"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": 1}]}
null
first attempt at recursive grabbing of category tree
borrowing approach from http://stackoverflow.com/a/28366310/7782 --> this query didn't recurse -- just grabbed the first level of descendents.
SELECT GROUP_CONCAT(lv SEPARATOR ',') FROM ( SELECT @pv:= ( SELECT GROUP_CONCAT(from_id SEPARATOR ',') FROM ( SELECT cl_from as from_id, p1.page_title as from_title, p2.page_id as to_id, cl_to as to_title, cl_type FROM categorylinks cl JOIN page p1 JOIN page p2 ON cl.cl_from = p1.page_id AND cl.cl_to = p2.page_title ) AS Folder WHERE to_id IN (@pv) ) AS lv FROM ( SELECT cl_from as from_id, p1.page_title as from_title, p2.page_id as to_id, cl_to as to_title, cl_type FROM categorylinks cl JOIN page p1 JOIN page p2 ON cl.cl_from = p1.page_id AND cl.cl_to = p2.page_title ) AS Folder2 JOIN (SELECT @pv:=(SELECT page_id FROM page WHERE page_title = 'Johann_Sebastian_Bach' AND page_namespace = 14)) tmp WHERE to_id IN (@pv) ) a;
{"resultsets": [{"headers": ["GROUP_CONCAT(lv SEPARATOR ',')"], "rowcount": 1}]}
null
phab:T100248
null
USE plwiktionary_p; SELECT * FROM tag_summary WHERE ts_tags = "script" ORDER BY ts_rev_id DESC LIMIT 50;
{"resultsets": [{"headers": ["ts_rc_id", "ts_log_id", "ts_rev_id", "ts_tags"], "rowcount": 50}]}
null
Counting pageviews
null
#use tewiki_p; #desc page; #select * from enwikipage select * from orwiki_p.page order by page_id desc limit 20; #select sum(page_counter) from page;
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_no_title_convert", "page_content_model"], "rowcount": 20}]}
null
Templates linking to disambiguation pages in Fa WP (part 2)
To investigate the specific template and see what disambiguation page it links to.
use fawiki_p; select pl_from, pl_title from pagelinks join page on pl_title = page_title join categorylinks on page_id = cl_from where page_namespace = 0 and pl_namespace = 0 and pl_from_namespace = 10 and cl_to = 'صفحه‌های_ابهام‌زدایی' and pl_from = 60825;
{"resultsets": [{"headers": ["pl_from", "pl_title"], "rowcount": 1}]}
null
categories containing Johann_Sebastian_Bach page in enwiki
null
SELECT * FROM categorylinks cl JOIN (SELECT page_id, page_title FROM page WHERE page_title = "Johann_Sebastian_Bach" and page_namespace=0) jsb ON cl.cl_from = jsb.page_id;
{"resultsets": [{"headers": ["cl_from", "cl_to", "cl_sortkey", "cl_timestamp", "cl_sortkey_prefix", "cl_collation", "cl_type", "page_id", "page_title"], "rowcount": 45}]}
null
Templates linking to disambiguation pages in Fa WP
Sorted by the # of times the template is used in the main namespace
use fawiki_p; select page_id, tl_title, count(tl_from) as cnt from templatelinks join page on tl_title = page_title where tl_namespace = 10 and tl_from_namespace = 0 and page_namespace = 10 and page_id in ( select pl_from from pagelinks join page on pl_title = page_title join categorylinks on page_id = cl_from where page_namespace = 0 and pl_namespace = 0 and pl_from_namespace = 10 and cl_to = 'صفحه‌های_ابهام‌زدایی' ) group by tl_title, page_id order by cnt desc;
{"resultsets": [{"headers": ["page_id", "tl_title", "cnt"], "rowcount": 1041}]}
null
Wikidata - search for labels or descriptions
null
# Search for items with specific labels # Example: term_text LIKE '% Miller' # could find people with last name "Miller" # Make sure to filter the resulting list of items for items with P31:Q5 use wikidatawiki_p; SELECT # CONCAT('Q', term_entity_id) As item, # term_text, # GROUP_CONCAT( term_language ) As lang, CONCAT('Q', term_entity_id) As item, CONCAT('D', term_language) As tr, CONCAT('"', term_text, '"') As current_desc, term_type, #CONCAT('"', term_text, '"') As current_desc, CURRENT_DATE from wb_terms WHERE term_entity_type = 'item' #AND term_type = 'label' # 'label', 'description', 'alias' AND term_type = 'description' # 'label', 'description', 'alias' AND term_language = 'en' #AND term_language in ('en', 'fr', 'it', 'de') #AND term_text LIKE 'a %' #AND term_text RLIKE '^[a-z]' AND ( term_text LIKE 'species of fungi' OR (term_text LIKE 'species of%' AND term_text LIKE '%s') ) GROUP BY term_text, term_entity_id #LIMIT 500
{"resultsets": [{"headers": ["item", "tr", "current_desc", "term_type", "#CONCAT('\"', term_text, '\"') As current_desc,\n\tCURRENT_DATE"], "rowcount": 3666}]}
null
IdeaLab
null
#-----IDEALAB EDITS #edits to the Idealab 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 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) #Grants and Grants_talk namespaces AND p.page_title LIKE "IdeaLab/%" AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #edits to the Idealab by WMF 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 edits_WMF 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) #Grants and Grants_talk namespaces AND p.page_title LIKE "IdeaLab/%" AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----IDEALAB EDITORS #unique editors to the Learning patterns 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(distinct rev_user) AS editors_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) #Grants and Grants_talk namespaces AND r.rev_timestamp > 20131001000000 AND p.page_title LIKE "IdeaLab/%" AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #unique editors to the IdeaLab by WMF 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(distinct rev_user) AS editors_WMF 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) #Grants and Grants_talk namespaces AND r.rev_timestamp > 20131001000000 AND p.page_title LIKE "IdeaLab/%" AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----IDEAS CREATED #count IdeaLab ideas created per month 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 ideas_created_by_Community 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 = 200 AND cl.cl_to IN ("IdeaLab/Ideas/IdeaLab") AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #count IdeaLab ideas created per month by WMF 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 ideas_created_WMF 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 = 200 AND cl.cl_to IN ("IdeaLab/Ideas/IdeaLab") AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----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 ON r.rev_page = p.page_id WHERE p.page_namespace IN (200) #Grants namespaces AND p.page_title LIKE "IdeaLab/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #Endorsements by WMF Staff 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 WMF_endorsements 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) #Grants namespaces AND p.page_title LIKE "IdeaLab/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC;
{"resultsets": [{"headers": ["year", "month", "edits_community"], "rowcount": 20}, {"headers": ["year", "month", "edits_WMF"], "rowcount": 20}, {"headers": ["year", "month", "editors_Community"], "rowcount": 20}, {"headers": ["year", "month", "editors_WMF"], "rowcount": 20}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 27}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 10}, {"headers": ["year", "month", "Community_endorsements"], "rowcount": 11}, {"headers": ["year", "month", "WMF_endorsements"], "rowcount": 11}]}
null
ערכים עם קואורדינטות ללא title
ערכים עם בתנתי קואורדינטות אך ללא קוארודינטות ראשיות (title)
use hewiki_p; select page_title from page where exists (select * from templatelinks where tl_title ='Coord' and tl_namespace=10 and tl_from=page_id) and not exists (select * from geo_tags where gt_page_id=page_id and gt_primary=1) and page_namespace=0;
{"resultsets": [{"headers": ["page_title"], "rowcount": 663}]}
null
Most linked disambiguation pages on Fa WP
Ideally, we would want to replace the links to go to the specific pages, not the disambiguation page.
use fawiki_p; select page_title, count(pl_from) cnt from page join categorylinks on page_id = cl_from join pagelinks on page_title = pl_title and page_namespace = pl_namespace where page_namespace = 0 and cl_to like '%ابهام%' group by page_title having cnt > 1000 order by cnt desc;
{"resultsets": [{"headers": ["page_title", "cnt"], "rowcount": 282}]}
null
20000 revisions from dewiki for revscores
null
USE dewiki_p; SELECT rc_this_oldid AS rev_id, rc_cur_id AS page_id FROM recentchanges LEFT JOIN user_groups ON recentchanges.rc_user = user_groups.ug_user WHERE (rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1)) AND user_groups.ug_user IS NULL ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 20000}]}
null
20000 revisions from eswiki for revscores
null
USE eswiki_p; SELECT rc_this_oldid AS rev_id, rc_cur_id AS page_id FROM recentchanges LEFT JOIN user_groups ON recentchanges.rc_user = user_groups.ug_user WHERE (rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1)) AND user_groups.ug_user IS NULL ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 20000}]}
null
20000 revisions from ruwiki for revscores
null
USE ruwiki_p; SELECT rc_this_oldid AS rev_id, rc_cur_id AS page_id FROM recentchanges LEFT JOIN user_groups ON recentchanges.rc_user = user_groups.ug_user WHERE (rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1)) AND user_groups.ug_user IS NULL ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 20000}]}
null
20000 revisions from simplewiki for revscores
null
USE simplewiki_p; SELECT rc_this_oldid AS rev_id, rc_cur_id AS page_id FROM recentchanges LEFT JOIN user_groups ON recentchanges.rc_user = user_groups.ug_user WHERE (rc_timestamp < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 2 DAY), "%Y%m%d%H%I%S") AND rc_type IN (0,1)) AND user_groups.ug_user IS NULL ORDER BY RAND() LIMIT 20000;
{"resultsets": [{"headers": ["rev_id", "page_id"], "rowcount": 8884}]}
null
Labels added in Wikidata Menu Challenge
Finds all labels added in Wikidata Menu Challenge. https://www.wikidata.org/wiki/Wikidata:Menu_Challenge More for an overview of activity since it does not capture everything.
USE wikidatawiki_p; SELECT page_title, rev_user_text, rev_timestamp, rev_comment FROM revision JOIN page ON rev_page = page_id WHERE page_title IN ("Q17", "Q34", "Q48", "Q89", "Q142", "Q152", "Q178", "Q195", "Q196", "Q500", "Q787", "Q830", "Q881", "Q1072", "Q5090", "Q6128", "Q6663", "Q7150", "Q7535", "Q7802", "Q8486", "Q8495", "Q9266", "Q9614", "Q9896", "Q10943", "Q10987", "Q10990", "Q10998", "Q11002", "Q11004", "Q11009", "Q11575", "Q13158", "Q13179", "Q13182", "Q13187", "Q13195", "Q13228", "Q13233", "Q13290", "Q14088", "Q17147", "Q20136", "Q21154", "Q22847", "Q23400", "Q23425", "Q23485", "Q23501", "Q25237", "Q26545", "Q26686", "Q28165", "Q28367", "Q28803", "Q33913", "Q34172", "Q35625", "Q36071", "Q36465", "Q37153", "Q37383", "Q37668", "Q37937", "Q39918", "Q41415", "Q41611", "Q41716", "Q44952", "Q45989", "Q46871", "Q47859", "Q58265", "Q80117", "Q81464", "Q82014", "Q93165", "Q93235", "Q120042", "Q127900", "Q130882", "Q131224", "Q131748", "Q132263", "Q133428", "Q134609", "Q138811", "Q152088", "Q152964", "Q153976", "Q154166", "Q155814", "Q155909", "Q156790", "Q156884", "Q161098", "Q164606", "Q165199", "Q165437", "Q167296", "Q167893", "Q170486", "Q177378", "Q178359", "Q179010", "Q179254", "Q186385", "Q188251", "Q188788", "Q188879", "Q191655", "Q191768", "Q192628", "Q192874", "Q193713", "Q198815", "Q199788", "Q201565", "Q203925", "Q204251", "Q204901", "Q207123", "Q208172", "Q209889", "Q211340", "Q213062", "Q214415", "Q217927", "Q229140", "Q229385", "Q234646", "Q235169", "Q241987", "Q249114", "Q251981", "Q256092", "Q264619", "Q275068", "Q275508", "Q275650", "Q276276", "Q277628", "Q283231", "Q289005", "Q300472", "Q311071", "Q322787", "Q342856", "Q344355", "Q349894", "Q383389", "Q388502", "Q390456", "Q404114", "Q408899", "Q426337", "Q427457", "Q432308", "Q460453", "Q461696", "Q466430", "Q470873", "Q504941", "Q513532", "Q522171", "Q545985", "Q549793", "Q553905", "Q564570", "Q599870", "Q599901", "Q615392", "Q622350", "Q625825", "Q636056", "Q638022", "Q643419", "Q667478", "Q715525", "Q725668", "Q727605", "Q742385", "Q784148", "Q807791", "Q816704", "Q828043", "Q840448", "Q847441", "Q851746", "Q854618", "Q860808", "Q864693", "Q865325", "Q865419", "Q867776", "Q895901", "Q904889", "Q917761", "Q945475", "Q957434", "Q966327", "Q1045910", "Q1057953", "Q1072192", "Q1072946", "Q1076906", "Q1089959", "Q1094882", "Q1106345", "Q1142459", "Q1156634", "Q1174370", "Q1188911", "Q1190414", "Q1200514", "Q1211297", "Q1322949", "Q1347028", "Q1359006", "Q1365996", "Q1420447", "Q1452513", "Q1501015", "Q1503716", "Q1503967", "Q1571226", "Q1572278", "Q1639520", "Q1650695", "Q1762893", "Q2114394", "Q2227032", "Q2255787", "Q2396858", "Q2459072", "Q2632776", "Q2690965", "Q2735024", "Q2763698", "Q2778993", "Q2920963", "Q2992510", "Q3073413", "Q3108255", "Q3246340", "Q3311757", "Q3393961", "Q3412448", "Q3596097", "Q3695900", "Q3733836", "Q3773650", "Q3776982", "Q3823549", "Q3919027", "Q4122049", "Q4865573", "Q4922798", "Q5005249", "Q5098941", "Q5125285", "Q5204114", "Q5256427", "Q5561980", "Q5706318", "Q6146274", "Q6501235", "Q7224757", "Q7323073", "Q7382955", "Q8752059", "Q8980672", "Q10497217", "Q10500882", "Q10500887", "Q10509700", "Q10510197", "Q10535659", "Q10572454", "Q10572617", "Q10575468", "Q10658749", "Q10669607", "Q10669634", "Q10699143", "Q10717939", "Q11175039", "Q11839576", "Q13099586", "Q13362654", "Q13377687", "Q13400960", "Q15223654", "Q16860983", "Q17118835", "Q19862464", "Q19862473", "Q19862495", "Q19862498", "Q3323634") AND (rev_comment LIKE('%wbsetlabel-add:%') OR rev_comment LIKE('%label(new%') ) AND rev_timestamp > '20150507220100' AND rev_timestamp < '20150527215900' ORDER BY rev_timestamp DESC
{"resultsets": [{"headers": ["page_title", "rev_user_text", "rev_timestamp", "rev_comment"], "rowcount": 2617}]}
null
Number of edits per user in Wikidata Menu Challenge
Lists all edits on the objects, not only those that are eligble for points.
USE wikidatawiki_p; SELECT rev_user_text, COUNT(rev_user_text) FROM revision JOIN page ON rev_page = page_id WHERE page_title IN ("Q17", "Q34", "Q48", "Q89", "Q142", "Q152", "Q178", "Q195", "Q196", "Q500", "Q787", "Q830", "Q881", "Q1072", "Q5090", "Q6128", "Q6663", "Q7150", "Q7535", "Q7802", "Q8486", "Q8495", "Q9266", "Q9614", "Q9896", "Q10943", "Q10987", "Q10990", "Q10998", "Q11002", "Q11004", "Q11009", "Q11575", "Q13158", "Q13179", "Q13182", "Q13187", "Q13195", "Q13228", "Q13233", "Q13290", "Q14088", "Q17147", "Q20136", "Q21154", "Q22847", "Q23400", "Q23425", "Q23485", "Q23501", "Q25237", "Q26545", "Q26686", "Q28165", "Q28367", "Q28803", "Q33913", "Q34172", "Q35625", "Q36071", "Q36465", "Q37153", "Q37383", "Q37668", "Q37937", "Q39918", "Q41415", "Q41611", "Q41716", "Q44952", "Q45989", "Q46871", "Q47859", "Q58265", "Q80117", "Q81464", "Q82014", "Q93165", "Q93235", "Q120042", "Q127900", "Q130882", "Q131224", "Q131748", "Q132263", "Q133428", "Q134609", "Q138811", "Q152088", "Q152964", "Q153976", "Q154166", "Q155814", "Q155909", "Q156790", "Q156884", "Q161098", "Q164606", "Q165199", "Q165437", "Q167296", "Q167893", "Q170486", "Q177378", "Q178359", "Q179010", "Q179254", "Q186385", "Q188251", "Q188788", "Q188879", "Q191655", "Q191768", "Q192628", "Q192874", "Q193713", "Q198815", "Q199788", "Q201565", "Q203925", "Q204251", "Q204901", "Q207123", "Q208172", "Q209889", "Q211340", "Q213062", "Q214415", "Q217927", "Q229140", "Q229385", "Q234646", "Q235169", "Q241987", "Q249114", "Q251981", "Q256092", "Q264619", "Q275068", "Q275508", "Q275650", "Q276276", "Q277628", "Q283231", "Q289005", "Q300472", "Q311071", "Q322787", "Q342856", "Q344355", "Q349894", "Q383389", "Q388502", "Q390456", "Q404114", "Q408899", "Q426337", "Q427457", "Q432308", "Q460453", "Q461696", "Q466430", "Q470873", "Q504941", "Q513532", "Q522171", "Q545985", "Q549793", "Q553905", "Q564570", "Q599870", "Q599901", "Q615392", "Q622350", "Q625825", "Q636056", "Q638022", "Q643419", "Q667478", "Q715525", "Q725668", "Q727605", "Q742385", "Q784148", "Q807791", "Q816704", "Q828043", "Q840448", "Q847441", "Q851746", "Q854618", "Q860808", "Q864693", "Q865325", "Q865419", "Q867776", "Q895901", "Q904889", "Q917761", "Q945475", "Q957434", "Q966327", "Q1045910", "Q1057953", "Q1072192", "Q1072946", "Q1076906", "Q1089959", "Q1094882", "Q1106345", "Q1142459", "Q1156634", "Q1174370", "Q1188911", "Q1190414", "Q1200514", "Q1211297", "Q1322949", "Q1347028", "Q1359006", "Q1365996", "Q1420447", "Q1452513", "Q1501015", "Q1503716", "Q1503967", "Q1571226", "Q1572278", "Q1639520", "Q1650695", "Q1762893", "Q2114394", "Q2227032", "Q2255787", "Q2396858", "Q2459072", "Q2632776", "Q2690965", "Q2735024", "Q2763698", "Q2778993", "Q2920963", "Q2992510", "Q3073413", "Q3108255", "Q3246340", "Q3311757", "Q3393961", "Q3412448", "Q3596097", "Q3695900", "Q3733836", "Q3773650", "Q3776982", "Q3823549", "Q3919027", "Q4122049", "Q4865573", "Q4922798", "Q5005249", "Q5098941", "Q5125285", "Q5204114", "Q5256427", "Q5561980", "Q5706318", "Q6146274", "Q6501235", "Q7224757", "Q7323073", "Q7382955", "Q8752059", "Q8980672", "Q10497217", "Q10500882", "Q10500887", "Q10509700", "Q10510197", "Q10535659", "Q10572454", "Q10572617", "Q10575468", "Q10658749", "Q10669607", "Q10669634", "Q10699143", "Q10717939", "Q11175039", "Q11839576", "Q13099586", "Q13362654", "Q13377687", "Q13400960", "Q15223654", "Q16860983", "Q17118835", "Q19862464", "Q19862473", "Q19862495", "Q19862498") AND rev_timestamp > '20150507220100' AND rev_timestamp < '20150527215900' GROUP BY rev_user_text Order by COUNT(rev_user_text) desc
{"resultsets": [{"headers": ["rev_user_text", "COUNT(rev_user_text)"], "rowcount": 157}]}
null
Deleted Wikidata items that could be Redirected
Show logs for deleted items that could have been redirected on Wikidata. Only show items that are still deleted
USE wikidatawiki_p; SELECT log_title, log_comment FROM logging WHERE log_type = 'delete' AND log_action = 'delete' AND log_namespace = 0 AND log_comment REGEXP '\\[\\[Q\\d+\\]\\]' AND log_comment REGEXP '(same as|duplicate|merge)' AND NOT EXISTS(SELECT 1 FROM page WHERE page_title=log_title);
{"resultsets": [{"headers": ["log_title", "log_comment"], "rowcount": 115602}]}
null
test
null
USE enwiki_p; SELECT rev_id, rev_parent_id, rev_timestamp, rev_user, rev_minor_edit, rev_page, rev_text_id, rev_comment, rev_user_text, rev_len FROM revision WHERE rev_timestamp >= "20140101" AND rev_timestamp <= "20140110";
{"resultsets": [{"headers": ["rev_id", "rev_parent_id", "rev_timestamp", "rev_user", "rev_minor_edit", "rev_page", "rev_text_id", "rev_comment", "rev_user_text", "rev_len"], "rowcount": 1342971}]}
null
Active editors fi >100
null
use fiwiki_p; select t.y,t.m,count(*) from (select rev_user, rev_user_text, YEAR(rev_timestamp) y,MONTH(rev_timestamp) m, 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(*)>100) as t group by t.y,t.m;
{"resultsets": [{"headers": ["y", "m", "count(*)"], "rowcount": 138}]}
null
Wikidata - names - Korean names
null
# List of Korean names and their aliases # FIXME: include names without any current aliases # Database scheme: https://upload.wikimedia.org/wikipedia/commons/f/f7/MediaWiki_1.24.1_database_schema.svg # without Wikidata tables (wb_entity_per_page, wb_terms) # Last three columns can be used as basis for adding aliases or properties with the QuickStatement tool # https://tools.wmflabs.org/wikidata-todo/quick_statements.php # # For discussion, see [[d:Wikidata talk:WikiProject Names]] use wikidatawiki_p; SELECT t1.term_text AS label, t2.term_text AS aliases, CONCAT('Q', t1.term_entity_id) AS Qid, 'Aen' AS QuickStateAction, #change to 'P1999' to add property P1999 CONCAT('"', t2.term_text,'"') AS Alias FROM pagelinks, wb_entity_per_page, wb_terms As t1, wb_terms As t2 WHERE pl_title = 'Q498782' # includes all items linking to item Q498782 ("Korean name") and pl_namespace = 0 and pl_from_namespace = 0 and epp_entity_type = 'item' and pl_from = epp_page_id and t1.term_entity_id = epp_entity_id and t2.term_entity_id = epp_entity_id and t1.term_entity_type = 'item' AND t1.term_language = 'en' and t1.term_type = 'label' and t2.term_entity_type = 'item' AND t2.term_language = 'en' and t2.term_type = 'alias' GROUP BY t1.term_entity_id, t2.term_text
{"resultsets": [{"headers": ["label", "aliases", "Qid", "QuickStateAction", "Alias"], "rowcount": 335}]}
null
FRK iesniegti CEE raksti
null
USE lvwiki_p; SELECT page_title as "Raksts", page_len as "Baitu skaits" FROM page WHERE page_title in ("Malborkas_pils", "Kijevas_Pečeru_klosteris", "Kijevas_Svētās_Sofijas_katedrāle", "Kumu_mākslas_muzejs", "Olga_Kuriļenko", "Hersonēsa", "Maskava_(upe)", "Novodevičjes_kapsēta", "Nadežda_Skardino", "Dinamo_stadions_(Minska)", "Spridzināšana_Minskas_metro", "Arams_Hačaturjans", "Veličkas_sāls_raktuves", "Marijas_teātris", "Svētā_Vita_katedrāle", "Kārļa_tilts", "Prāgas_hrada", "Karlovi_Vari", "Ūsti_pie_Labas", "Vīnes_Svētā_Stefana_katedrāle", "Vīnes_Valsts_opera", "O2_arēna_(Prāga)", "Dejojošā_māja", "Viļņas_katedrāle", "Kristijons_Donelaitis", "Vincs_Kudirka", "Ģedimina_tornis", "Andrejs_Zadneprovskis", "Treblinkas_nāves_nometne", "Prāgas_astronomiskais_pulkstenis", "Valērijs_Borzovs", "Karaliskā_pils_Varšavā", "Simtgades_zāle", "George_Hadži", "Ilie_Nestase", "Jolanda_Balaša", "Diokletiāna_pils", "Jasnaja_Poļana", "Lazenku_parks", "Staronova_sinagoga", "Mcheta", "Butrinti", "Merķine", "Fjodors_Tjutčevs", "Rilas_klosteris", "Māte_Dzimtene_sauc", "Jarmila_Kratohvīlova", "Ā_(Igaunija)", "Pergama", "Hatušaša", "Nemrutdags", "Dēla", "Vrangeļa_sala", "Hija", "Marija_Kallasa", "Eiropa_(mitoloģija)", "Mīnojs", "Vladimirs_Voroņins", "Postojnas_ala", "Polībijs", "Budas_pils", "Pāls_Šmits", "Mehmeda_pašā_Sokoloviča_tilts", "Armēņu_genocīda_memoriālais_komplekss", "Bratislavas_Svētā_Mārtiņa_katedrāle", "Turkistāna", "Pafa", "Sobiboras_nāves_nometne", "Gžegožs_Fitelbergs", "Dzelzs_vārti", "Ludmila_Gurčenko", "Sandra_Perkoviča", "Radegasts_Paroleks", "Skopjes_cietoksnis", "Gobustana_(rezervāts)", "Milo_Džukanovičs", "Mihails_Gļinka", "Srebrenicas_slaktiņš", "Pagaidi_tikai!", "Brāļi_Karamazovi") group by page_title
{"resultsets": [{"headers": ["Raksts", "Baitu skaits"], "rowcount": 80}]}
null
Get the categories for an image.
[[commons:File:New_born_Frisian_red_white_calf.jpg]]
USE commonswiki_p; SELECT cl_to FROM categorylinks INNER JOIN page ON page_id = cl_from WHERE page_namespace = 6 AND page_title = "New_born_Frisian_red_white_calf.jpg"
{"resultsets": [{"headers": ["cl_to"], "rowcount": 17}]}
null
lvwiki invalid navbar links
Jāpārbauda visi en:Wikipedia:Database reports/Invalid Navbar links esošie varianti
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, '_', ' ') /* 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, '_', ' ') 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, '_', ' ') 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, '_', ' ') 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, '_', ' ') 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
Small lvwiki articles not marked as stubs
null
#from http://quarry.wmflabs.org/query/1135 use lvwiki_p; SELECT page_title, page_len FROM page WHERE page_namespace = 0 AND page_len < 1000 AND page_is_redirect = 0 and page_title NOT LIKE "%gads" AND page_id NOT IN ( SELECT tl_from FROM templatelinks WHERE tl_title IN ("Asbox", "Nozīmju_atdalīšana", "Copyvio", "Autortiesību_problēmas", "Īss_aizmetnis", "Disambig") ) ORDER BY page_len ASC LIMIT 100; /* http://quarry.wmflabs.org/query/871 use iswiki_p; SELECT page_title, page_len FROM page WHERE page_namespace = 0 AND page_len < 1000 AND page_is_redirect = 0 AND page_id NOT IN ( SELECT pp_page FROM page_props WHERE pp_propname IN ('disambiguation') ) AND page_id NOT IN ( SELECT tl_from FROM templatelinks WHERE tl_title IN ('Stubbur') ) ORDER BY page_len ASC LIMIT 300; */
{"resultsets": [{"headers": ["page_title", "page_len"], "rowcount": 100}]}
null
Wikidata - labels with leading space
null
use wikidatawiki_p; SELECT CONCAT('Q', term_entity_id) As item, term_text, term_language As lang, CURRENT_DATE from wb_terms WHERE term_entity_type = 'item' #AND term_language in ('en') AND term_type = 'label' AND term_text LIKE ' %' GROUP BY term_text, term_language
{"resultsets": [{"headers": ["item", "term_text", "lang", "CURRENT_DATE"], "rowcount": 151}]}
null
Edgars2007's testing area 2
null
USE enwiki_p; SELECT tl_from FROM templatelinks #LEFT JOIN page p ON tl_title = p.page_title where tl_title="Navbar" and tl_namespace=828 and tl_from_namespace=10 and tl_from not in (SELECT tl_from FROM templatelinks where (tl_title="Infobox" or tl_title="Sidebar")# or and (tl_namespace=10 or tl_namespace=828) and tl_from_namespace=10) and tl_from not in (SELECT tl_from FROM templatelinks where tl_title="Navbar" and tl_namespace=10 and tl_from_namespace=10) limit 50;
{"resultsets": [{"headers": ["tl_from"], "rowcount": 50}]}
null
Fa WP user edit/log counts in the last three years
null
use fawiki_p; select rev_user, user_name, u.ug_group, count(rev_timestamp) editcount, l.logcount from revision join user on rev_user = user_id left join ( select ug_user, ug_group from user_groups where ug_group = 'sysop' ) u on u.ug_user = user_id left join ( select log_user, count(log_id) as logcount from logging where log_timestamp > '20120603000000' group by log_user ) l on l.log_user = rev_user where rev_timestamp > '20120603000000' and rev_user not in ( select ug_user from user_groups where ug_group = 'bot' ) group by rev_user , user_name, u.ug_group ;
{"resultsets": [{"headers": ["rev_user", "user_name", "ug_group", "editcount", "logcount"], "rowcount": 51567}]}
null
Nakhlestan
null
use fawiki_p; select page_title, rev_longest_len from revision join ( select rev_page as rev_first_page, min(rev_timestamp) as rev_first_timestamp from revision group by rev_page ) f on rev_page = rev_first_page and rev_timestamp = rev_first_timestamp join ( select rev_page as rev_longest_page, max(rev_len) as rev_longest_len from revision group by rev_page ) l on rev_page = rev_longest_page join page on rev_page = page_id where rev_user = 150579 and page_namespace = 0 and page_is_redirect = 0 ;
{"resultsets": [{"headers": ["page_title", "rev_longest_len"], "rowcount": 248}]}
null
Fa WP articles with only a few edits way in the past
Articles that are not protected, have only been edited less than 5 times, and their last edit happened more than a year ago but the article was created less than two years ago. This does NOT count minor edits (so that if an article has been edited more recently but only by bots, it would still show up in the results).
use fawiki_p; select page_id, page_title, rev_count, rev_latest_major, max(rev_len) from ( select rev_page, max(rev_timestamp) as rev_latest_major from revision where rev_minor_edit <> 1 group by rev_page having rev_latest_major < '20140603000000' ) lm join ( select rev_page, max(rev_timestamp) as rev_latest from revision group by rev_page ) l join ( select rev_page, min(rev_timestamp) as rev_earliest from revision group by rev_page having rev_earliest > '20130703000000' ) e on lm.rev_page = e.rev_page join ( select rev_page, rev_timestamp, rev_len from revision ) ln on ln.rev_page = lm.rev_page and ln.rev_timestamp = l.rev_latest join ( select rev_page, count(rev_timestamp) as rev_count from revision where rev_minor_edit <> 1 group by rev_page having rev_count < 5 ) c on lm.rev_page = c.rev_page join page on lm.rev_page = page_id and page_namespace = 0 and page_is_redirect = 0 left outer join page_restrictions on lm.rev_page = pr_page where pr_page is null and lm.rev_page not in ( select cl_from from categorylinks where cl_to like '%ابهام%' ) group by page_id, page_title, rev_count, rev_latest_major ;
{"resultsets": [{"headers": ["page_id", "page_title", "rev_count", "rev_latest_major", "max(rev_len)"], "rowcount": 62008}]}
null
Library science category activity
null
SELECT rc.rc_id, rc.rc_cur_id, rc.rc_title, rc.rc_timestamp, rc.rc_this_oldid, rc.rc_last_oldid, rc.rc_user_text, rc.rc_old_len, rc.rc_new_len, rc.rc_comment FROM recentchanges AS rc INNER JOIN categorylinks AS cl ON rc.rc_cur_id = cl.cl_from WHERE cl.cl_to = 'Library_science' AND rc.rc_timestamp >= DATE_SUB(NOW(), INTERVAL 2 HOUR) ORDER BY rc.rc_timestamp DESC
{"resultsets": [{"headers": ["rc_id", "rc_cur_id", "rc_title", "rc_timestamp", "rc_this_oldid", "rc_last_oldid", "rc_user_text", "rc_old_len", "rc_new_len", "rc_comment"], "rowcount": 2}]}
null
Edits in the past 30 days
null
select count(*) from recentchanges where rc_user_text = 'Slaporte' and rc_timestamp >= DATE_SUB(NOW(), INTERVAL 30 DAY)
{"resultsets": [{"headers": ["count(*)"], "rowcount": 1}]}
null
Bytes added by Salebot
null
use frwiki_p; SELECT SUBSTRING(rev_timestamp,1,6) AS rev_month, FORMAT(SUM(rev_len), 0) AS rev_bytes, FORMAT(COUNT(rev_id), 0) AS rev_count FROM revision WHERE rev_user_text="Salebot" GROUP BY rev_month;
{"resultsets": [{"headers": ["rev_month", "rev_bytes", "rev_count"], "rowcount": 93}]}
null
Women total, not bots, with at least 1 edit, Swedish Language WP
null
SELECT COUNT(DISTINCT rev_user) AS WomenTotal FROM svwiki_p.revision WHERE rev_user IN ( SELECT user_id FROM svwiki_p.user JOIN svwiki_p.user_properties ON user_id=up_user WHERE up_property = 'gender' AND up_value = 'female' ); SELECT COUNT(DISTINCT rev_user) AS MenTotal FROM svwiki_p.revision WHERE rev_user IN ( SELECT user_id FROM svwiki_p.user JOIN svwiki_p.user_properties ON user_id=up_user WHERE up_property = 'gender' AND up_value = 'male' ); SELECT COUNT(DISTINCT rev_user) as Total FROM svwiki_p.revision WHERE rev_user IN ( SELECT user_id FROM svwiki_p.user );
{"resultsets": [{"headers": ["WomenTotal"], "rowcount": 1}, {"headers": ["MenTotal"], "rowcount": 1}, {"headers": ["Total"], "rowcount": 1}]}
null
slash-slash-space
Descriptions starting with '// '
USE wikidatawiki_p; SELECT CONCAT("Q",term_entity_id), term_language, term_text FROM wb_terms WHERE term_type="description" AND term_entity_type="item" AND term_text LIKE "%// %";
{"resultsets": [{"headers": ["CONCAT(\"Q\",term_entity_id)", "term_language", "term_text"], "rowcount": 3}]}
null
Hewiki subtemplates category project
null
use hewiki_p; select (case when page_title like "%/%" then "ATTENTION" else "z" end) as slash, replace(page_title, "_", " ") as title, page_restrictions as restrictions, page_len as length from page where page_namespace = 10 and page_is_redirect = 0 and not exists (select * from categorylinks where page_id = cl_from)
{"resultsets": [{"headers": ["slash", "title", "restrictions", "length"], "rowcount": 241}]}
null
User pages with Infobox person template not edited by user
Gives list of all user pages which need deletion, as they are not edited by the concerned user, following inclusion of Infobox person template by other wikipedians.
use tewiki_p; SELECT DISTINCT page_title FROM page LEFT JOIN templatelinks ON tl_from = page_id WHERE tl_namespace = 10 AND tl_title = "Infobox_person" AND page.page_namespace = 2 AND page_is_redirect =0 AND page_title NOT REGEXP ".+[/|.].+" AND page_title NOT IN (SELECT page_title FROM page RIGHT JOIN revision ON revision.rev_page=page.page_id WHERE page_namespace = 2 AND page_is_redirect =0 AND rev_user!=0 AND (REPLACE(page_title,"_"," ") = rev_user_text) AND page_title NOT REGEXP ".+[/|.].+") GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_title"], "rowcount": 0}]}
null
Images tagged with {{free media}} on enwiki
null
use enwiki_p; SELECT count(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": ["count(page_title)"], "rowcount": 1}]}
null
Images tagged with {{Non-free media}} on enwiki
null
use enwiki_p; SELECT count(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 ('Non-free_media') );
{"resultsets": [{"headers": ["count(page_title)"], "rowcount": 1}]}
null
Images tagged with neither {{Free media}} nor {{Non-free media}} on enwiki
Images tagged with neither {{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 NOT IN ( SELECT DISTINCT(tl_from) FROM templatelinks WHERE tl_namespace = 10 AND tl_from_namespace = 6 AND tl_title IN ('Free_media') ) AND page_id NOT IN ( SELECT DISTINCT(tl_from) FROM templatelinks WHERE tl_namespace = 10 AND tl_from_namespace = 6 AND tl_title IN ('Non-free_media') );
{"resultsets": [{"headers": ["page_title"], "rowcount": 7836}]}
null
Files uploaded to Commons in 2015 with a GFDL license
null
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(cl_from) FROM categorylinks WHERE categorylinks.cl_to LIKE 'GFDL' );
{"resultsets": [{"headers": ["count(page_title)"], "rowcount": 1}]}
null
Wikidata - labels with two spaces
null
use wikidatawiki_p; SELECT CONCAT('Q', term_entity_id) As item, term_text, term_language As lang, CURRENT_DATE from wb_terms WHERE term_entity_type = 'item' AND term_language in ('en') AND term_type = 'label' # change to 'description' AND term_text LIKE '% %' GROUP BY term_text, term_language
{"resultsets": [{"headers": ["item", "term_text", "lang", "CURRENT_DATE"], "rowcount": 801}]}
null
Terms of P357
null
SELECT * FROM wikidatawiki_p.wb_terms WHERE term_entity_id = 357 AND term_entity_type = "property"
{"resultsets": [{"headers": ["term_row_id", "term_entity_id", "term_entity_type", "term_language", "term_type", "term_text", "term_search_key", "term_weight"], "rowcount": 125}]}
null
Terms of P1476
null
SELECT * FROM wikidatawiki_p.wb_terms WHERE term_entity_id = 1476 AND term_entity_type = "property"
{"resultsets": [{"headers": ["term_row_id", "term_entity_id", "term_entity_type", "term_language", "term_type", "term_text", "term_search_key", "term_weight"], "rowcount": 92}]}
null
The evil label non-uniqueness
null
SELECT * FROM wikidatawiki_p.wb_terms WHERE term_entity_type = "property" AND term_language = "gl" AND term_type = "label" AND term_text = "título~"
{"resultsets": [{"headers": ["term_row_id", "term_entity_id", "term_entity_type", "term_language", "term_type", "term_text", "term_search_key", "term_weight"], "rowcount": 2}]}
null
Uniqueness check
null
select term_entity_type,term_type,term_language,term_text,term_entity_id FROM wikidatawiki_p.`wb_terms` WHERE ((term_language='gl' AND term_search_key='título~' AND term_type='label' AND term_entity_type='property')) LIMIT 10;
{"resultsets": [{"headers": ["term_entity_type", "term_type", "term_language", "term_text", "term_entity_id"], "rowcount": 2}]}
null
Edits per day
null
use commonswiki_p;SELECT substr( rc_timestamp, 1, 8 ), count(distinct rc_cur_id) from recentchanges where rc_source = 'mw.edit' group by 1;
{"resultsets": [{"headers": ["substr( rc_timestamp, 1, 8 )", "count(distinct rc_cur_id)"], "rowcount": 31}]}
null
Articles created on lgwiki between January 2014 and February 2015
null
USE lgwiki_p; SELECT page_title AS 'Article', rev_user_text AS 'Created by user', rev_timestamp AS 'Time' FROM revision JOIN page ON rev_page = page_id WHERE rev_parent_id = 0 AND rev_timestamp > '20140101000000' AND rev_timestamp < '20150301000000' AND page_namespace= 0
{"resultsets": [{"headers": ["Article", "Created by user", "Time"], "rowcount": 264}]}
null
Yona draft
null
USE hewiki_p; SELECT page_namespace, page_title, rd_title FROM page JOIN redirect ON rd_from = page_id WHERE page_namespace = rd_namespace AND page_namespace in (10, 14)
{"resultsets": [{"headers": ["page_namespace", "page_title", "rd_title"], "rowcount": 845}]}
null
Grants
null
#-----EVALUATION PORTAL EDITS #edits to the Evaluation portal_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 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 r.rev_timestamp > 20131001000000 AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #edits to the Evaluation portal_WMF 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 edits_WMF 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 r.rev_timestamp > 20131001000000 AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----EVALUATION PORTAL EDITORS #unique editors to the evaulation portal 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(distinct rev_user) AS editors_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) #Grants and Grants_talk namespaces AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #unique editors to the evaulation portal WMF 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(distinct rev_user) AS editors_WMF 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) #Grants and Grants_talk namespaces AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 #exclude IP edits and editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----EVALUATION PORTAL PAGES CREATED #Pages Created 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 Grants_pages_by_Community 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 = 200 AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #Pages Created by WMF staff 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 Grants_pages_by_WMF 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 = 200 AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC;
{"resultsets": [{"headers": ["year", "month", "edits_community"], "rowcount": 21}, {"headers": ["year", "month", "edits_WMF"], "rowcount": 21}, {"headers": ["year", "month", "editors_Community"], "rowcount": 21}, {"headers": ["year", "month", "editors_WMF"], "rowcount": 21}, {"headers": ["year", "month", "Grants_pages_by_Community"], "rowcount": 68}, {"headers": ["year", "month", "Grants_pages_by_WMF"], "rowcount": 47}]}
null
Learning Patterns
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`, EXTRACT(Month from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `month`, 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.page_title LIKE "Learning_patterns/%" AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #edits to the LEARNING PATTERNS by WMF 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 edits_WMF 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.page_title LIKE "Learning_patterns/%" AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----LEARNING PATTERNS EDITORS #unique editors to the Learning patterns 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(distinct rev_user) AS editors_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 r.rev_timestamp > 20131001000000 AND p.page_title LIKE "Learning_patterns/%" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #unique editors to the LEARNING PATTERNS by WMF 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(distinct rev_user) AS editors_WMF 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 r.rev_timestamp > 20131001000000 AND p.page_title LIKE "Learning_patterns/%" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----IDEAS CREATED #count LEARNING PATTERNS ideas created per month 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 ideas_created_by_Community 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 = 200 AND cl.cl_to IN ("Learning_patterns") AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #count LEARNING PATTERNS ideas created per month by WMF 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 ideas_created_WMF 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 = 200 AND cl.cl_to IN ("Learning_patterns") AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----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 ON r.rev_page = p.page_id WHERE p.page_namespace IN (200) #Grants namespaces AND p.page_title LIKE "Learning_pattern/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #Endorsements by WMF Staff 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 WMF_endorsements 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) AND p.page_title LIKE "Learning_pattern/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC;
{"resultsets": [{"headers": ["year", "month", "edits_community"], "rowcount": 21}, {"headers": ["year", "month", "edits_WMF"], "rowcount": 21}, {"headers": ["year", "month", "editors_Community"], "rowcount": 21}, {"headers": ["year", "month", "editors_WMF"], "rowcount": 21}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 20}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 19}, {"headers": ["year", "month", "Community_endorsements"], "rowcount": 0}, {"headers": ["year", "month", "WMF_endorsements"], "rowcount": 0}]}
null
Education Toolkit
null
#-----EDUCATION TOOLKIT EDITS #edits to the EDUCATION TOOLKIT 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 edits_community 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, 201) AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 AND cl.cl_to LIKE "Education_patterns" AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #edits to the LEARNING PATTERNS by WMF 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 edits_WMF 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, 201) AND r.rev_timestamp > 20131001000000 AND r.rev_user != 0 AND cl.cl_to LIKE "Education_patterns" AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----EDUCATION TOOLKIT EDITORS #unique editors to the Learning patterns 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(distinct rev_user) AS editors_Community 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, 201) AND r.rev_timestamp > 20131001000000 AND cl.cl_to LIKE "Education_patterns" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #unique editors to the LEARNING PATTERNS by WMF 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(distinct rev_user) AS editors_WMF 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, 201) AND r.rev_timestamp > 20131001000000 AND cl.cl_to LIKE "Education_patterns" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----NEW EDUCATION PATTERNS CREATED #count EDUCATION PATTERNS created per month 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 ideas_created_by_Community 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 = 200 AND cl.cl_to LIKE "Education_patterns" AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #count EDUCATION PATTERNS created per month by WMF 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 ideas_created_WMF 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 = 200 AND cl.cl_to LIKE "Education_patterns" AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----EDUCATION 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 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) #Grants namespaces AND cl.cl_to LIKE "Education_patterns" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #Endorsements by WMF Staff 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 WMF_endorsements 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_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC;
{"resultsets": [{"headers": ["year", "month", "edits_community"], "rowcount": 13}, {"headers": ["year", "month", "edits_WMF"], "rowcount": 16}, {"headers": ["year", "month", "editors_Community"], "rowcount": 13}, {"headers": ["year", "month", "editors_WMF"], "rowcount": 16}, {"headers": ["year", "month", "ideas_created_by_Community"], "rowcount": 8}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 9}, {"headers": ["year", "month", "Community_endorsements"], "rowcount": 7}, {"headers": ["year", "month", "WMF_endorsements"], "rowcount": 9}]}
null
Daily anonymous mobile edits from German Wikipedia
https://quarry.wmflabs.org/query/2634
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 "20141101" AND "20150616" AND rev_user = 0 GROUP BY date;
{"resultsets": [{"headers": ["date", "COUNT(*)"], "rowcount": 96}]}
null
Village pages in tewp
null
use tewiki_p; SELECT DISTINCT(page_title) FROM page LEFT JOIN (SELECT * from categorylinks) cl1 ON cl1.cl_from = page.page_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND cl1.cl_to LIKE '%_జిల్లా_గ్రామాలు' and page_title NOT IN (SELECT DISTINCT(page_title) FROM page LEFT JOIN (SELECT * from categorylinks) cl2 ON cl2.cl_from = page.page_id WHERE page.page_namespace = 0 AND page_is_redirect =0 AND cl2.cl_to LIKE '%నగరాలు_మరియు_పట్టణాలు' ) GROUP BY page_title ORDER BY page_title
{"resultsets": [{"headers": ["page_title"], "rowcount": 29820}]}
null
Links to Jordanian universities
null
USE enwiki_p; SELECT DISTINCT page_title, el_to FROM page JOIN externallinks ON el_from=page_id WHERE page_namespace=0 AND el_to LIKE "%.ju.edu.jo%" ORDER BY page_title DESC;
{"resultsets": [{"headers": ["page_title", "el_to"], "rowcount": 77}]}
null
Edits made to [[w:en:Bee]] that have Edit tags
Edits made to [[w:en:Bee]] that have [[w:en:Wikipedia:Tags|edit tags]]
use enwiki_p; SELECT * FROM tag_summary WHERE ts_rev_id IN ( SELECT rev_id FROM revision WHERE rev_page = 4654 );
{"resultsets": [{"headers": ["ts_rc_id", "ts_log_id", "ts_rev_id", "ts_tags"], "rowcount": 3}]}
null
User groups of all users who have edited [[w:en:Bee]]
See also http://quarry.wmflabs.org/query/3992
use enwiki_p; SELECT * FROM user_groups WHERE ug_user IN ( SELECT DISTINCT rev_user FROM revision WHERE rev_page = 4654 );
{"resultsets": [{"headers": ["ug_user", "ug_group"], "rowcount": 555}]}
null
Lielākās attēlu aprakstu lapas
null
USE lvwiki_p; SELECT CONCAT('#[[:File:',page.page_title,']]') AS Filename, page_len FROM page WHERE page_namespace=6 AND page_is_redirect=0 ORDER BY page_len DESC limit 10;
{"resultsets": [{"headers": ["Filename", "page_len"], "rowcount": 10}]}
null
نوشتارهای درسطح‌مدیران‌بی‌پایان‌محافظت‌شده
null
use fawiki_p; SELECT page_is_redirect, page_title FROM page_restrictions JOIN page ON page_id = pr_page AND page_namespace = 0 AND pr_type = 'edit' AND pr_level = 'sysop' AND pr_expiry = 'infinity';
{"resultsets": [{"headers": ["page_is_redirect", "page_title"], "rowcount": 11}]}
null
Blocked usernames in arwiki
Blocked users because of username's policy with prevent account creation- requested by محمد الفلسطيني
USE arwiki_p; SELECT user_name FROM user JOIN ipblocks ON user_id=ipb_user AND ipb_reason LIKE "%اسم_مستخدم%" AND ipb_create_account=1
{"resultsets": [{"headers": ["user_name"], "rowcount": 505}]}
null
LPL Q3 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.page_title LIKE "Learning_patterns/%" AND r.rev_timestamp > 20140101000000 AND r.rev_timestamp < 20140401000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`; #edits to the LEARNING PATTERNS by WMF SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_WMF 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.page_title LIKE "Learning_patterns/%" AND r.rev_timestamp > 20140101000000 AND r.rev_timestamp < 20140401000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`; #-----LEARNING PATTERNS EDITORS #unique editors to the Learning patterns Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(distinct rev_user) AS editors_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 r.rev_timestamp > 20140101000000 AND r.rev_timestamp < 20140401000000 AND p.page_title LIKE "Learning_patterns/%" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`; #unique editors to the LEARNING PATTERNS by WMF SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(distinct rev_user) AS editors_WMF 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 r.rev_timestamp > 20140101000000 AND r.rev_timestamp < 20140401000000 AND p.page_title LIKE "Learning_patterns/%" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`; #-----IDEAS CREATED #count LEARNING PATTERNS ideas created per month 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 ideas_created_by_Community 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 = 200 AND cl.cl_to IN ("Learning_patterns") AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #count LEARNING PATTERNS ideas created per month by WMF 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 ideas_created_WMF 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 = 200 AND cl.cl_to IN ("Learning_patterns") AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----LEARNING PATTERNS ENDORSEMENTS #Endorsements by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS Community_endorsements 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) #Grants namespaces AND p.page_title LIKE "Learning_pattern/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_timestamp > 20140101000000 AND r.rev_timestamp < 20140401000000 GROUP BY `year`; #Endorsements by WMF Staff SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS WMF_endorsements 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) AND p.page_title LIKE "Learning_pattern/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) AND r.rev_timestamp > 20140101000000 AND r.rev_timestamp < 20140401000000 GROUP BY `year`;
{"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}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 20}, {"headers": ["year", "Community_endorsements"], "rowcount": 0}, {"headers": ["year", "WMF_endorsements"], "rowcount": 0}]}
null
LPL Q2 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.page_title LIKE "Learning_patterns/%" AND r.rev_timestamp > 20131001000000 AND r.rev_timestamp < 20140101000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`; #edits to the LEARNING PATTERNS by WMF SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS edits_WMF 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.page_title LIKE "Learning_patterns/%" AND r.rev_timestamp > 20131001000000 AND r.rev_timestamp < 20140101000000 AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`; #-----LEARNING PATTERNS EDITORS #unique editors to the Learning patterns Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(distinct rev_user) AS editors_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 r.rev_timestamp > 20131001000000 AND r.rev_timestamp < 20140101000000 AND p.page_title LIKE "Learning_patterns/%" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") GROUP BY `year`; #unique editors to the LEARNING PATTERNS by WMF SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(distinct rev_user) AS editors_WMF 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 r.rev_timestamp > 20131001000000 AND r.rev_timestamp < 20140101000000 AND p.page_title LIKE "Learning_patterns/%" AND r.rev_user != 0 AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot GROUP BY `year`; #-----IDEAS CREATED #count LEARNING PATTERNS ideas created per month 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 ideas_created_by_Community 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 = 200 AND cl.cl_to IN ("Learning_patterns") AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #count LEARNING PATTERNS ideas created per month by WMF 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 ideas_created_WMF 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 = 200 AND cl.cl_to IN ("Learning_patterns") AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) #not a non-standard staff account OR User:FuzzyBot AND r.rev_parent_id = 0 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #-----LEARNING PATTERNS ENDORSEMENTS #Endorsements by Community SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS Community_endorsements 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) #Grants namespaces AND p.page_title LIKE "Learning_pattern/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan") AND r.rev_timestamp > 20131001000000 AND r.rev_timestamp < 20140101000000 GROUP BY `year`; #Endorsements by WMF Staff SELECT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`, COUNT(rev_id) AS WMF_endorsements 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) AND p.page_title LIKE "Learning_pattern/%" AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%")) AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND (r.rev_user_text LIKE "%(WMF)" OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan")) AND r.rev_timestamp > 20131001000000 AND r.rev_timestamp < 20140101000000 GROUP BY `year`;
{"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}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 20}, {"headers": ["year", "Community_endorsements"], "rowcount": 0}, {"headers": ["year", "WMF_endorsements"], "rowcount": 0}]}
null
Should be tagged by WikiProject Women Scientists (enwiki)
Goes through the categories tagged by WikiProject Women Scientists, finds articles and categories not tagged by WikiProject Women Scientists.
use enwiki_p; select distinct page.page_namespace,page.page_title from page join categorylinks on categorylinks.cl_from = page.page_id where page_namespace in (0, 14) # main namespace and category namespace and cl_to in ( select page.page_title from page join categorylinks on categorylinks.cl_from = page.page_id where page_namespace = 15 and cl_to = "Category-Class_Women_scientists_articles") and page_title not in ( select distinct page.page_title from page join categorylinks on categorylinks.cl_from = page.page_id where page_namespace in (1, 15) # talk namespace and category_talk namespace and cl_to in ("A-Class_Women_scientists_articles", "B-Class_Women_scientists_articles", "C-Class_Women_scientists_articles", "Disambig-Class_Women_scientists_articles", "FL-Class_Women_scientists_articles", "GA-Class_Women_scientists_articles", "List-Class_Women_scientists_articles", "Start-Class_Women_scientists_articles", "Stub-Class_Women_scientists_articles", "Unassessed_Women_scientists_articles", "Category-Class_Women_scientists_articles"));
{"resultsets": [{"headers": ["page_namespace", "page_title"], "rowcount": 502}]}
null
Commons file pages linking to non-existing users
null
USE commonswiki_p; SELECT page_title AS file_name, pl_title AS user_name FROM pagelinks INNER JOIN page ON pl_from_namespace = 6 AND pl_namespace = 2 AND pl_title LIKE '"%"' AND pl_title NOT LIKE '%/%' AND page_id = pl_from LEFT JOIN user ON user_name = REPLACE( pl_title, '_', ' ' ) WHERE user_name IS NULL LIMIT 500
{"resultsets": [{"headers": ["file_name", "user_name"], "rowcount": 202}]}
null
SVG maps from 2015-02 onwards used 4-10 times in the Spanish Wikipedia
SVG maps from 2015-02 onwards used 4-10 times in the Spanish Wikipedia. Excluding those in category Historical_SVG_maps_in_Spanish and those in categories having "ocator" (locator) and "lag" (flag) in their categories. The filtering is done by looking for SVG files uploaded after February 2015, having at least a category with the word "map" in it. From the suggestion at https://commons.wikimedia.org/wiki/Commons:Village_pump#How_to_perform_complex_file_searches_in_Commons
use commonswiki_p; Select img_name, cl_to, count(*) from image inner join globalimagelinks on gil_to = img_name inner join page on page_namespace=6 and page_title = img_name inner join categorylinks on cl_from = page_id where img_media_type = 'DRAWING' and img_major_mime="image" and img_minor_mime = 'svg+xml' and cl_to not like 'Historical_SVG_maps_in_Spanish' and (cl_to like '%map%' and cl_to not like '%ocat%' and cl_to not like '%lag%') and gil_wiki = 'eswiki' and img_timestamp > 20140200000000 group by img_name , cl_to having count(*) < 10 and count(*)>4 limit 100;
{"resultsets": [{"headers": ["img_name", "cl_to", "count(*)"], "rowcount": 100}]}
null
Īsākie nozīmīgie raksti
null
use lvwiki_p; SELECT pl.pl_title, max(p2.page_len) FROM page p1 JOIN pagelinks pl ON pl.pl_from = p1.page_id join page p2 on pl.pl_title=p2.page_title WHERE p1.page_namespace = 4 AND p1.page_title = "Nozīmīgi_raksti" and pl.pl_namespace=0 group by pl.pl_title
{"resultsets": [{"headers": ["pl_title", "max(p2.page_len)"], "rowcount": 1000}]}
null
Yesterday's recentchanges
null
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_namespace = 0 AND rc_timestamp < DATE_FORMAT(CURDATE(), '%Y%m%d%H%i%s') AND rc_timestamp > DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 DAY), '%Y%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": 90683}]}
null
Ranked Article Activity
null
SELECT rc_cur_id AS page_id, rc_title AS title, COUNT(*) AS edits, COUNT(DISTINCT rc_user) AS users FROM recentchanges WHERE rc_namespace = 0 AND rc_type = 0 AND rc_timestamp > 20150110215640 GROUP BY page_id ORDER BY edits DESC LIMIT 50
{"resultsets": [{"headers": ["page_id", "title", "edits", "users"], "rowcount": 50}]}
null
Tool Labs metadata database
Content of the metadata database; see https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Database#Metadata_database for more information.
use meta_p; SELECT * FROM wiki;
{"resultsets": [{"headers": ["dbname", "lang", "name", "family", "url", "size", "slice", "is_closed", "has_echo", "has_flaggedrevs", "has_visualeditor", "has_wikidata", "is_sensitive"], "rowcount": 861}]}
null
All users who have edited [[w:en:Bee]]
null
use enwiki_p; SELECT * FROM user WHERE user_id IN ( SELECT DISTINCT rev_user FROM revision WHERE rev_page = 4654 );
{"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": 920}]}
null
orphaned TimedText @[[:com:]]
null
use commonswiki_p; select CONCAT('*[[:TimedText:', page_title,']] used by [[:File:', substr( page_title, 1, length( page_title ) - length( substring_index( page_title, '.' ,-2 ) ) - 1 ) , ']]' ) as '==oTT==' from page left outer join image on substr( page_title, 1, length( page_title ) - length( substring_index( page_title, '.' ,-2 ) ) - 1 ) = img_name where page_namespace =102 and img_name is null;
{"resultsets": [{"headers": ["==oTT=="], "rowcount": 5}]}
null
video_metadata
null
use commonswiki_p; select img_name , img_size , img_media_type, img_major_mime, img_minor_mime, img_metadata from image where img_media_type = 'VIDEO' #and img_name = 'Eruption_and_Possible_Current_Sheet_on_the_Limb_-Hinode_XRT-.webm' # and length(img_metadata) > 1 limit 10
{"resultsets": [{"headers": ["img_name", "img_size", "img_media_type", "img_major_mime", "img_minor_mime", "img_metadata"], "rowcount": 10}]}
null
All revisions of [[w:en:Bee]]
null
use enwiki_p; SELECT * FROM revision WHERE rev_page = 4654 ORDER BY rev_timestamp, rev_id;
{"resultsets": [{"headers": ["rev_id", "rev_page", "rev_text_id", "rev_comment", "rev_user", "rev_user_text", "rev_timestamp", "rev_minor_edit", "rev_deleted", "rev_len", "rev_parent_id", "rev_sha1", "rev_content_model", "rev_content_format"], "rowcount": 3333}]}
null
50,000 revisions from frwiki for revscores
null
USE frwiki_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 fawiki for revscores
null
USE fawiki_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 ptwiki for revscores
null
USE ptwiki_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 azwiki for revscores
null
USE azwiki_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 trwiki for revscores
null
USE trwiki_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
Hot articles last week on Swedish Wikipedia
Articles that have been edited many times by many editors the last week on Wikipedia.
SELECT COUNT(rev_page)*COUNT(DISTINCT rev_user) AS 'Edits times unique editors', page_title AS 'Article' FROM svwiki_p.revision JOIN svwiki_p.page ON rev_page = page_id WHERE page_namespace = 0 AND rev_timestamp > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 8 DAY),'%Y%m%d%H%i%s') GROUP BY page_title ORDER BY COUNT(page_title) desc LIMIT 20
{"resultsets": [{"headers": ["Edits times unique editors", "Article"], "rowcount": 20}]}
null
{{Infobox company}} and {{Coord}}
Pages with both {{Infobox company}} and {{Coord}}
SELECT page_title FROM templatelinks tlic, templatelinks tlco, page WHERE tlic.tl_namespace = 10 AND tlic.tl_title = 'Infobox_company' AND tlco.tl_namespace = 10 AND tlco.tl_title = 'Coord' AND tlic.tl_from_namespace = 0 AND tlic.tl_from_namespace = tlco.tl_from_namespace AND tlic.tl_from = tlco.tl_from AND page_id = tlic.tl_from AND page_namespace = 0 ORDER BY page_title
{"resultsets": [{"headers": ["page_title"], "rowcount": 2044}]}
null
Tühjad või lühikesed artiklid
null
USE etwiki_p; SELECT page_title, page_len FROM page WHERE page_namespace = 0 AND page_is_redirect = 0 AND page_len < 30 ORDER BY page_len ASC;
{"resultsets": [{"headers": ["page_title", "page_len"], "rowcount": 0}]}
null
Ümbersuunamised teise nimeruumi
null
USE etwiki_p; SELECT rd_namespace, rd_title, page_title FROM page JOIN redirect ON redirect.rd_from = page.page_id WHERE page.page_namespace = 0 AND redirect.rd_namespace <> 0
{"resultsets": [{"headers": ["rd_namespace", "rd_title", "page_title"], "rowcount": 50}]}
null
Most frequent domains (Estonian Wikipedia)
null
USE etwiki_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": 247}]}
null
gadu raksti
null
use lvwiki_p; SELECT p.page_title#, t4.rev_page, t4.rev_comment FROM revision AS t4 join page p on t4.rev_page=p.page_id WHERE t4.rev_id IN ( Select min(t45.rev_id) From revision t45 inner join page p on t45.rev_page=p.page_id where p.page_namespace=0 and p.page_is_redirect=0 group by t45.rev_page having min(t45.rev_id) order by min(t45.rev_id) desc ) and t4.rev_user_text<>"Wert" and p.page_title LIKE "%gads"
{"resultsets": [{"headers": ["page_title"], "rowcount": 1143}]}
null
Images added in the Wikidata Menu Challenge
Images (i.e. Property:P18) added in the Wikidata Menu Challenge. https://www.wikidata.org/wiki/Wikidata:Menu_Challenge
USE wikidatawiki_p; SELECT rev_comment FROM revision JOIN page ON rev_page = page_id WHERE page_title IN ("Q17", "Q34", "Q48", "Q89", "Q142", "Q152", "Q178", "Q195", "Q196", "Q500", "Q787", "Q830", "Q881", "Q1072", "Q5090", "Q6128", "Q6663", "Q7150", "Q7535", "Q7802", "Q8486", "Q8495", "Q9266", "Q9614", "Q9896", "Q10943", "Q10987", "Q10990", "Q10998", "Q11002", "Q11004", "Q11009", "Q11575", "Q13158", "Q13179", "Q13182", "Q13187", "Q13195", "Q13228", "Q13233", "Q13290", "Q14088", "Q17147", "Q20136", "Q21154", "Q22847", "Q23400", "Q23425", "Q23485", "Q23501", "Q25237", "Q26545", "Q26686", "Q28165", "Q28367", "Q28803", "Q33913", "Q34172", "Q35625", "Q36071", "Q36465", "Q37153", "Q37383", "Q37668", "Q37937", "Q39918", "Q41415", "Q41611", "Q41716", "Q44952", "Q45989", "Q46871", "Q47859", "Q58265", "Q80117", "Q81464", "Q82014", "Q93165", "Q93235", "Q120042", "Q127900", "Q130882", "Q131224", "Q131748", "Q132263", "Q133428", "Q134609", "Q138811", "Q152088", "Q152964", "Q153976", "Q154166", "Q155814", "Q155909", "Q156790", "Q156884", "Q161098", "Q164606", "Q165199", "Q165437", "Q167296", "Q167893", "Q170486", "Q177378", "Q178359", "Q179010", "Q179254", "Q186385", "Q188251", "Q188788", "Q188879", "Q191655", "Q191768", "Q192628", "Q192874", "Q193713", "Q198815", "Q199788", "Q201565", "Q203925", "Q204251", "Q204901", "Q207123", "Q208172", "Q209889", "Q211340", "Q213062", "Q214415", "Q217927", "Q229140", "Q229385", "Q234646", "Q235169", "Q241987", "Q249114", "Q251981", "Q256092", "Q264619", "Q275068", "Q275508", "Q275650", "Q276276", "Q277628", "Q283231", "Q289005", "Q300472", "Q311071", "Q322787", "Q342856", "Q344355", "Q349894", "Q383389", "Q388502", "Q390456", "Q404114", "Q408899", "Q426337", "Q427457", "Q432308", "Q460453", "Q461696", "Q466430", "Q470873", "Q504941", "Q513532", "Q522171", "Q545985", "Q549793", "Q553905", "Q564570", "Q599870", "Q599901", "Q615392", "Q622350", "Q625825", "Q636056", "Q638022", "Q643419", "Q667478", "Q715525", "Q725668", "Q727605", "Q742385", "Q784148", "Q807791", "Q816704", "Q828043", "Q840448", "Q847441", "Q851746", "Q854618", "Q860808", "Q864693", "Q865325", "Q865419", "Q867776", "Q895901", "Q904889", "Q917761", "Q945475", "Q957434", "Q966327", "Q1045910", "Q1057953", "Q1072192", "Q1072946", "Q1076906", "Q1089959", "Q1094882", "Q1106345", "Q1142459", "Q1156634", "Q1174370", "Q1188911", "Q1190414", "Q1200514", "Q1211297", "Q1322949", "Q1347028", "Q1359006", "Q1365996", "Q1420447", "Q1452513", "Q1501015", "Q1503716", "Q1503967", "Q1571226", "Q1572278", "Q1639520", "Q1650695", "Q1762893", "Q2114394", "Q2227032", "Q2255787", "Q2396858", "Q2459072", "Q2632776", "Q2690965", "Q2735024", "Q2763698", "Q2778993", "Q2920963", "Q2992510", "Q3073413", "Q3108255", "Q3246340", "Q3311757", "Q3393961", "Q3412448", "Q3596097", "Q3695900", "Q3733836", "Q3773650", "Q3776982", "Q3823549", "Q3919027", "Q4122049", "Q4865573", "Q4922798", "Q5005249", "Q5098941", "Q5125285", "Q5204114", "Q5256427", "Q5561980", "Q5706318", "Q6146274", "Q6501235", "Q7224757", "Q7323073", "Q7382955", "Q8752059", "Q8980672", "Q10497217", "Q10500882", "Q10500887", "Q10509700", "Q10510197", "Q10535659", "Q10572454", "Q10572617", "Q10575468", "Q10658749", "Q10669607", "Q10669634", "Q10699143", "Q10717939", "Q11175039", "Q11839576", "Q13099586", "Q13362654", "Q13377687", "Q13400960", "Q15223654", "Q16860983", "Q17118835", "Q19862464", "Q19862473", "Q19862495", "Q19862498") AND rev_comment LIKE('%wbsetclaim-create:2||1 */ [[Property:P18]]%') AND rev_timestamp > '20150507220100' AND rev_timestamp < '20150527215900' ORDER BY rev_timestamp DESC
{"resultsets": [{"headers": ["rev_comment"], "rowcount": 102}]}
null
Pronunciation audio added in Wikidata Menu Challenge
Pronunciation audio (i.e. Property:P443) added in Wikidata Menu Challenge. https://www.wikidata.org/wiki/Wikidata:Menu_Challenge
USE wikidatawiki_p; SELECT rev_comment FROM revision JOIN page ON rev_page = page_id WHERE page_title IN ("Q17", "Q34", "Q48", "Q89", "Q142", "Q152", "Q178", "Q195", "Q196", "Q500", "Q787", "Q830", "Q881", "Q1072", "Q5090", "Q6128", "Q6663", "Q7150", "Q7535", "Q7802", "Q8486", "Q8495", "Q9266", "Q9614", "Q9896", "Q10943", "Q10987", "Q10990", "Q10998", "Q11002", "Q11004", "Q11009", "Q11575", "Q13158", "Q13179", "Q13182", "Q13187", "Q13195", "Q13228", "Q13233", "Q13290", "Q14088", "Q17147", "Q20136", "Q21154", "Q22847", "Q23400", "Q23425", "Q23485", "Q23501", "Q25237", "Q26545", "Q26686", "Q28165", "Q28367", "Q28803", "Q33913", "Q34172", "Q35625", "Q36071", "Q36465", "Q37153", "Q37383", "Q37668", "Q37937", "Q39918", "Q41415", "Q41611", "Q41716", "Q44952", "Q45989", "Q46871", "Q47859", "Q58265", "Q80117", "Q81464", "Q82014", "Q93165", "Q93235", "Q120042", "Q127900", "Q130882", "Q131224", "Q131748", "Q132263", "Q133428", "Q134609", "Q138811", "Q152088", "Q152964", "Q153976", "Q154166", "Q155814", "Q155909", "Q156790", "Q156884", "Q161098", "Q164606", "Q165199", "Q165437", "Q167296", "Q167893", "Q170486", "Q177378", "Q178359", "Q179010", "Q179254", "Q186385", "Q188251", "Q188788", "Q188879", "Q191655", "Q191768", "Q192628", "Q192874", "Q193713", "Q198815", "Q199788", "Q201565", "Q203925", "Q204251", "Q204901", "Q207123", "Q208172", "Q209889", "Q211340", "Q213062", "Q214415", "Q217927", "Q229140", "Q229385", "Q234646", "Q235169", "Q241987", "Q249114", "Q251981", "Q256092", "Q264619", "Q275068", "Q275508", "Q275650", "Q276276", "Q277628", "Q283231", "Q289005", "Q300472", "Q311071", "Q322787", "Q342856", "Q344355", "Q349894", "Q383389", "Q388502", "Q390456", "Q404114", "Q408899", "Q426337", "Q427457", "Q432308", "Q460453", "Q461696", "Q466430", "Q470873", "Q504941", "Q513532", "Q522171", "Q545985", "Q549793", "Q553905", "Q564570", "Q599870", "Q599901", "Q615392", "Q622350", "Q625825", "Q636056", "Q638022", "Q643419", "Q667478", "Q715525", "Q725668", "Q727605", "Q742385", "Q784148", "Q807791", "Q816704", "Q828043", "Q840448", "Q847441", "Q851746", "Q854618", "Q860808", "Q864693", "Q865325", "Q865419", "Q867776", "Q895901", "Q904889", "Q917761", "Q945475", "Q957434", "Q966327", "Q1045910", "Q1057953", "Q1072192", "Q1072946", "Q1076906", "Q1089959", "Q1094882", "Q1106345", "Q1142459", "Q1156634", "Q1174370", "Q1188911", "Q1190414", "Q1200514", "Q1211297", "Q1322949", "Q1347028", "Q1359006", "Q1365996", "Q1420447", "Q1452513", "Q1501015", "Q1503716", "Q1503967", "Q1571226", "Q1572278", "Q1639520", "Q1650695", "Q1762893", "Q2114394", "Q2227032", "Q2255787", "Q2396858", "Q2459072", "Q2632776", "Q2690965", "Q2735024", "Q2763698", "Q2778993", "Q2920963", "Q2992510", "Q3073413", "Q3108255", "Q3246340", "Q3311757", "Q3393961", "Q3412448", "Q3596097", "Q3695900", "Q3733836", "Q3773650", "Q3776982", "Q3823549", "Q3919027", "Q4122049", "Q4865573", "Q4922798", "Q5005249", "Q5098941", "Q5125285", "Q5204114", "Q5256427", "Q5561980", "Q5706318", "Q6146274", "Q6501235", "Q7224757", "Q7323073", "Q7382955", "Q8752059", "Q8980672", "Q10497217", "Q10500882", "Q10500887", "Q10509700", "Q10510197", "Q10535659", "Q10572454", "Q10572617", "Q10575468", "Q10658749", "Q10669607", "Q10669634", "Q10699143", "Q10717939", "Q11175039", "Q11839576", "Q13099586", "Q13362654", "Q13377687", "Q13400960", "Q15223654", "Q16860983", "Q17118835", "Q19862464", "Q19862473", "Q19862495", "Q19862498") AND rev_comment LIKE('%wbsetclaim-create:2||1 */ [[Property:P443]]%') AND rev_timestamp > '20150507220100' AND rev_timestamp < '20150527215900' ORDER BY rev_timestamp DESC
{"resultsets": [{"headers": ["rev_comment"], "rowcount": 1140}]}
null
Redirects with external links
null
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(COUNT(*)/10) DESC, el_index
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "el_to", "COUNT(*)"], "rowcount": 1248}]}
null
old and new rev length snippet
null
SELECT page_title, Rev1.`rev_len` as NewRev, Rev2.`rev_len` as OldRev from enwiki_p.revision as Rev1 JOIN enwiki_p.`revision` as Rev2 on Rev2.rev_id = Rev1.rev_parent_id JOIN enwiki_p.page on `page_id` = Rev1.rev_page WHERE page_title = "Water";
{"resultsets": [{"headers": ["page_title", "NewRev", "OldRev"], "rowcount": 8692}]}
null
Latvian cross namespace redirects
http://quarry.wmflabs.org/query/922
use lvwiki_p; use lvwiki_p; SELECT pl_namespace, pl_from_namespace, page_title, page_id FROM page INNER JOIN pagelinks ON pl_from = page_id AND pl_namespace != pl_from_namespace WHERE page_is_redirect = 1 order by pl_from_namespace desc, page_title asc LIMIT 800
{"resultsets": [{"headers": ["pl_namespace", "pl_from_namespace", "page_title", "page_id"], "rowcount": 582}]}
null
Latest Bureaucratic actions in Fa WP
To get a sense of which bureaucrats are active.
USE fawiki_p; SELECT log_id, log_user_text, log_title, log_timestamp, log_comment, log_params FROM logging WHERE log_type = 'rights' AND log_action = 'rights' AND ( (log_params NOT LIKE '%sysop%newgroups%sysop%' AND log_params LIKE '%newgroups%sysop%') OR (log_params NOT LIKE '%bureaucrat%newgroups%bureaucrat%' AND log_params LIKE '%newgroups%bureaucrat%') OR (log_params NOT LIKE '%bot%newgroups%bot%' AND log_params LIKE '%newgroups%bot%') OR (log_params NOT LIKE '%patroller%newgroups%patroller%' AND log_params LIKE '%newgroups%patroller%') ) ORDER BY log_timestamp DESC LIMIT 100;
{"resultsets": [{"headers": ["log_id", "log_user_text", "log_title", "log_timestamp", "log_comment", "log_params"], "rowcount": 100}]}
null
All .js pages in MW namespace
null
use fawiki_p; select concat('MediaWiki:', page_title) from page where page_title like '%.js' and page_namespace = 8;
{"resultsets": [{"headers": ["concat('MediaWiki:', page_title)"], "rowcount": 240}]}
null
Users of Wiki Loves Monuments 2014 in France
Useful to get the cohort from WLM 2014
USE commonswiki_p; SELECT /* SLOW_OK */ img_user_text AS "USER", COUNT(img_name) AS "COUNT" 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 = "Images_from_Wiki_Loves_Monuments_2014_in_France" GROUP BY img_user_text;
{"resultsets": [{"headers": ["USER", "COUNT"], "rowcount": 801}]}
null
Most common thanker/thanked unordered pairs
null
USE lvwiki_p; SELECT LEAST(REPLACE(log_title,'_',' '),log_user_text), GREATEST(REPLACE(log_title,'_',' '), log_user_text), COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY 1, 2 ORDER BY 3 DESC LIMIT 100;
{"resultsets": [{"headers": ["LEAST(REPLACE(log_title,'_',' '),log_user_text)", "GREATEST(REPLACE(log_title,'_',' '), log_user_text)", "COUNT(*)"], "rowcount": 100}]}
null
Most thanked editors (lvwiki)
null
USE lvwiki_p; SELECT log_title, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY log_title ORDER BY COUNT(*) DESC LIMIT 100;
{"resultsets": [{"headers": ["log_title", "COUNT(*)"], "rowcount": 100}]}
null
Less active users on plwiki
null
USE plwiki_p; SELECT user_id, CONCAT("[[User:",user_name,"|",user_name,"]]") AS user_name, user_editcount, user_registration/*, $wgGroupPermissions*/ FROM user WHERE user_name NOT LIKE '%bot%' AND user_registration > 20150101000000 AND user_registration < 20150601000000 AND user_editcount > 50 AND user_editcount < 100
{"resultsets": [{"headers": ["user_id", "user_name", "user_editcount", "user_registration"], "rowcount": 80}]}
null
An old query
null
use wikidatawiki_p; SELECT rev_user_text, COUNT(*) FROM revision WHERE rev_comment LIKE '/* wbcreateclaim-create:2| */ [[Property:P106]]%' AND rev_comment RLIKE '\[Q(56923|83460|111837|132851|152951|152956|157148|158668|165654|186024|189290|214443|275102|335954|493898|506249|648329|675594|694005|727229|842486|852661|983927|2357674|2961982|5013228|7820253|15983795)\]' GROUP BY rev_user_text ORDER BY COUNT(*) DESC;
{"resultsets": [{"headers": ["rev_user_text", "COUNT(*)"], "rowcount": 129}]}
null
Veidnes ar ambox
der arī neizmantotajām veidnēm?
use lvwiki_p; select concat("Veidne:",page_title) from page where page_title like "Convert%" and page_is_redirect=0 and page_namespace=10 /*use lvwiki_p; SELECT p1.page_namespace, p1.page_title FROM redirect AS rd JOIN page p1 ON rd.rd_from = p1.page_id LEFT JOIN page AS p2 ON rd_namespace = p2.page_namespace AND rd_title = p2.page_title WHERE rd_namespace >= 0 AND p2.page_namespace IS NULL ORDER BY p1.page_namespace ASC; Select * from redirect where rd_title like "Futb%" and rd_namespace=10 limit 100; use lvwiki_p; Select * from pagelinks where pl_from in (Select page_id from pagelinks join page on page_title=pl_title where pl_from=291630 and pl_namespace=10) limit 10; Select concat("*[[Veidne:",p.page_title,"]]") as 'Veidne' from page p left join templatelinks tl on p.page_title=tl.tl_title #select concat("*[[Veidne:",tl_title,"]]") as 'Veidne' #from templatelinks #join page p on p.page_id=t.tl_from where p.page_title like "Futb%" and p.page_namespace=10 and tl.tl_from is NULL limit 300;*/
{"resultsets": [{"headers": ["concat(\"Veidne:\",page_title)"], "rowcount": 23}]}
null