title
stringlengths 1
212
| description
stringlengths 1
4.39k
⌀ | query
stringlengths 1
65.5k
⌀ | extra_info
stringlengths 18
31.6k
| wikidb
stringlengths 4
26
⌀ |
---|---|---|---|---|
IdeaLab endorsers per month | null | SELECT COUNT(rev_user_text) AS participants, 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`
FROM metawiki_p.page AS p
JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
JOIN metawiki_p.revision AS r
ON p.page_id = r.rev_page
WHERE cl.cl_to IN ("IdeaLab/Ideas/IdeaLab")
AND cl.cl_type = "page"
AND p.page_namespace = 200
AND p.page_title LIKE "IdeaLab/%"
AND (r.rev_comment LIKE ("%Endorse%") OR r.rev_comment LIKE ("%endorse%") OR r.rev_comment LIKE ("%Involve%"))
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["participants", "year", "month"], "rowcount": 7}]} | null |
WLM France 2014 | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2014_in_France")
AND r.rev_timestamp > 20140901020000
AND r.rev_timestamp < 20141001015959
#7
AND r.rev_parent_id = 0; | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 795}]} | null |
LPL Unique Users | null | #unique editors to the idealab by WMF
SELECT DISTINCT EXTRACT(Year from DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) as `year`,
r.rev_user_text AS editors 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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "Learning_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_timestamp > 20150101000000
AND r.rev_timestamp < 20150115000000; | {"resultsets": [{"headers": ["year", "editors"], "rowcount": 17}]} | null |
IdeaLab ideas per month | null | 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)
FROM metawiki_p.page AS p
JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
JOIN metawiki_p.revision AS r
ON p.page_id = r.rev_page
WHERE cl.cl_to IN ("IdeaLab/Ideas/IdeaLab")
AND cl.cl_type = "page"
AND p.page_namespace = 200
AND p.page_title LIKE "IdeaLab/%"
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["year", "month", "COUNT(rev_id)"], "rowcount": 20}]} | null |
All IdeaLab ideas | with creator, creation date and edit comment | SELECT page_title, rev_user_text, EXTRACT(YEAR FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `year`,
EXTRACT(MONTH FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `month`, rev_comment
FROM metawiki_p.page AS p
JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
JOIN metawiki_p.revision AS r
ON p.page_id = r.rev_page
WHERE cl.cl_to IN ("IdeaLab/Ideas/IdeaLab")
AND cl.cl_type = "page"
AND p.page_namespace = 200
AND p.page_title LIKE "IdeaLab/%"
AND p.page_title NOT LIKE "%/%/%"
AND r.rev_parent_id = 0; | {"resultsets": [{"headers": ["page_title", "rev_user_text", "year", "month", "rev_comment"], "rowcount": 130}]} | null |
Learning patterns created per month | no 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)
FROM metawiki_p.page AS p
JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
JOIN metawiki_p.revision AS r
ON p.page_id = r.rev_page
WHERE cl.cl_to IN ("Learning_patterns")
AND cl.cl_type = "page"
AND p.page_namespace = 200
AND p.page_title LIKE "Learning_patterns/%"
AND r.rev_user_text NOT LIKE "%(WMF)%"
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["year", "month", "COUNT(rev_id)"], "rowcount": 15}]} | null |
PEG draft submissions | with creator, create date and edit comment | SELECT page_title, rev_user_text, EXTRACT(YEAR FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `year`,
EXTRACT(MONTH FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `month`, rev_comment
FROM metawiki_p.page AS p
JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
JOIN metawiki_p.revision AS r
ON p.page_id = r.rev_page
WHERE cl.cl_to IN ("WMF_grant_drafts")
AND cl.cl_type = "page"
AND p.page_namespace = 200
AND p.page_title LIKE "PEG/%"
AND r.rev_parent_id = 0; | {"resultsets": [{"headers": ["page_title", "rev_user_text", "year", "month", "rev_comment"], "rowcount": 25}]} | null |
IdeaLab editors by month | including distinct ips | #unique editors to the idealab namespace
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_text) AS editors 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_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", "FuzzyBot", "Wolliff") #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", "editors"], "rowcount": 16}]} | null |
First 100 users of dewiki by id | These are the 100 'oldest' users of German Wikipedia. | USE dewiki_p;
SELECT user_id, user_name, user_editcount
FROM user
LIMIT 100; | {"resultsets": [{"headers": ["user_id", "user_name", "user_editcount"], "rowcount": 100}]} | null |
Number of articles in other languages | null | USE cewiki_p;
SELECT ll_lang, COUNT(*) as total FROM langlinks LEFT JOIN page
ON page_id = ll_from
WHERE page_namespace = 0
GROUP BY ll_lang; | {"resultsets": [{"headers": ["ll_lang", "total"], "rowcount": 283}]} | null |
WLM Thailand 2013 | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2013_in_Argentina")
AND r.rev_timestamp > 20130831210000
AND r.rev_timestamp < 20130930205959
#7
AND r.rev_parent_id = 0; | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 142}]} | null |
Redirect a potenziali disambigue | null | USE itwiki_p;
SELECT CONCAT('# [[', page_title, ']]')
FROM page, pagelinks
WHERE page_namespace = 0
AND page_is_redirect = 1
AND page_id = pl_from
AND pl_namespace = 0
AND pl_title IN
(SELECT page_title
FROM page, templatelinks
WHERE page_id = tl_from
AND tl_namespace = 10
AND page_namespace = 0
AND tl_title = 'Nota_disambigua')
AND pl_title NOT IN
(SELECT page_title
FROM page, templatelinks
WHERE page_id = tl_from
AND tl_namespace = 10
AND page_namespace = 0
AND tl_title = 'Bio')
ORDER BY page_title | {"resultsets": [{"headers": ["CONCAT('# [[', page_title, ']]')"], "rowcount": 33103}]} | null |
Adição de ESR com FastButtons por usuário por dia | considerando apenas edições que não foram eliminadas, do dia 19/12/2014 a 18/1/2015 | USE ptwiki_p;
SELECT
rc_user_text USUÁRIO,
SUBSTR(rc_timestamp, 1, 8) DIA,
COUNT(*)
FROM recentchanges
WHERE rc_comment = 'Página proposta para [[WP:ESR|eliminação semirrápida]], usando [[WP:FastButtons|FastButtons]]'
GROUP BY rc_user, DIA; | {"resultsets": [{"headers": ["USU\u00c1RIO", "DIA", "COUNT(*)"], "rowcount": 69}]} | null |
Articles with red link images(missing) in Telugu Wikipedia | null | USE tewiki_p;
SELECT
page_title,
il_to
FROM page
JOIN imagelinks
ON page_id = il_from
WHERE (NOT EXISTS(
SELECT
1
FROM image
WHERE img_name = il_to))
AND (NOT EXISTS(
SELECT
1
FROM commonswiki_p.page
WHERE page_title = il_to
AND page_namespace = 6))
AND page_namespace = 0; | {"resultsets": [{"headers": ["page_title", "il_to"], "rowcount": 2328}]} | null |
Namespace - page count Tewikisource | null | USE tewikisource_p;
SELECT
page_namespace,
MAX(notredir),
MAX(redir)
FROM (
SELECT page.page_namespace,
IF( page_is_redirect, COUNT(page.page_namespace), 0 ) AS redir,
IF( page_is_redirect, 0, COUNT(page.page_namespace)) AS notredir
FROM page
GROUP BY page_is_redirect, page_namespace
ORDER BY page_namespace, page_is_redirect
) AS pagetmp
GROUP BY page_namespace; | {"resultsets": [{"headers": ["page_namespace", "MAX(notredir)", "MAX(redir)"], "rowcount": 23}]} | null |
Musical instruments on fawiki | null | USE fawiki_p;
SELECT `page_title` FROM `page` WHERE `page_is_redirect` = 0 AND `page_namespace` = 0 AND ((`page_title` LIKE 'ساز%' OR `page_title` LIKE '%(ساز%)') AND `page_title` NOT LIKE 'سازی%' AND `page_title` NOT LIKE 'سازش%' AND `page_title` NOT LIKE 'سازگار%' AND `page_title` NOT LIKE 'سازه%' AND `page_title` NOT LIKE 'ساختمان%' AND `page_title` NOT LIKE 'سازند%' AND `page_title` NOT LIKE 'سازمان%' AND `page_title` NOT LIKE 'سازگاز%' AND `page_title` NOT LIKE 'سازو%' AND `page_title` NOT LIKE '%(سازی%)' AND `page_title` NOT LIKE '%(ساختمان%)' AND `page_title` NOT LIKE '%(سازو%)' AND `page_title` NOT LIKE '%(سازگار%)' AND `page_title` NOT LIKE '%(سازمان%)' AND `page_title` NOT LIKE '%(سازه%)' AND `page_title` NOT LIKE '%(سازش%)') GROUP BY `page_title` ORDER BY `page_title` ASC; | {"resultsets": [{"headers": ["page_title"], "rowcount": 42}]} | null |
List of PSM article titles | null | USE enwikisource_p;
SELECT enwikisource_p.page.*
FROM page
WHERE page.page_title
LIKE ('Popular_Science_Monthly_Volume%')
AND page.page_namespace = 0;
| {"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": 8932}]} | null |
Feature articles that appeared on the mainpage in English Wikipedia | Gathers a list of articles whose talk pages appear in the hidden category "Featured_articles_that_have_appeared_on_the_main_page" along with their categorization date. | SELECT
article.page_id,
article.page_title,
cl_timestamp
FROM categorylinks
INNER JOIN page talk_page ON
talk_page.page_namespace = 1 AND
cl_from = talk_page.page_id
INNER JOIN page article ON
article.page_namespace = 0 AND
article.page_title = talk_page.page_title
WHERE cl_to = "Featured_articles_that_have_appeared_on_the_main_page"; | {"resultsets": [{"headers": ["page_id", "page_title", "cl_timestamp"], "rowcount": 4002}]} | null |
WLM Thailand 2013 Cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2013_in_Thailand")
AND r.rev_timestamp > 20130831170000
AND r.rev_timestamp < 20130930165959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 180}]} | null |
Grants unique editors by quarter | null | #WMF EDITORS - GRANTS NAMESPACE
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 Grants_WMF_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan"));
#COMMUNITY EDITORS - GRANTS NAMESPACE
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 Grants_Community_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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");
#WMF EDITORS - EVALUATION NAMESPACE
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 Evaluation_WMF_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND p.page_title LIKE "Evaluation%"
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan"));
#COMMUNITY EDITORS - EVALUATION NAMESPACE
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 Evaluation_Community_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND p.page_title LIKE "Evaluation%"
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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");
#WMF EDITORS - LEARNING PATTERNS NAMESPACE
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 LearningPatterns_WMF_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND p.page_title LIKE "Learning_patterns/%"
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan"));
#COMMUNITY EDITORS - LEARNING PATTERNS NAMESPACE
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 LearningPatterns_Community_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND p.page_title LIKE "Learning_patterns/%"
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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");
#WMF EDITORS - IDEALAB NAMESPACE
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 IdeaLab_WMF_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND p.page_title LIKE "IdeaLab/%"
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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", "Frank_Schulenburg", "Jtmorgan","SarahStierch","Wolliff","anasuyas","Chedasaurus","Ciphers","floorkoudijs","Janstee","jwild","kittycarmichael","Macruzbar","Msannakoval","Opinenow","Satihsu","Tighef","zhengan"));
#COMMUNITY EDITORS - IDEALAB NAMESPACE
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 IdeaLab_Community_editors 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND p.page_title LIKE "IdeaLab/%"
AND r.rev_timestamp > 20131001000000
AND r.rev_timestamp < 20140101000000
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");
| {"resultsets": [{"headers": ["year", "month", "Grants_WMF_editors"], "rowcount": 1}, {"headers": ["year", "month", "Grants_Community_editors"], "rowcount": 1}, {"headers": ["year", "month", "Evaluation_WMF_editors"], "rowcount": 1}, {"headers": ["year", "month", "Evaluation_Community_editors"], "rowcount": 1}, {"headers": ["year", "month", "LearningPatterns_WMF_editors"], "rowcount": 1}, {"headers": ["year", "month", "LearningPatterns_Community_editors"], "rowcount": 1}, {"headers": ["year", "month", "IdeaLab_WMF_editors"], "rowcount": 1}, {"headers": ["year", "month", "IdeaLab_Community_editors"], "rowcount": 1}]} | null |
WLM Serbia 2014 Cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2014_in_Serbia")
AND r.rev_timestamp > 20140831220000
AND r.rev_timestamp < 20140930215959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 81}]} | null |
Wikidata - overview of properties with Dutch label | null | use wikidatawiki_p;
SELECT CONCAT('P', term_entity_id) as eigenschapnaam, term_text as eigenschaplabel
from wb_terms
WHERE term_entity_type = 'property' AND term_language = 'nl' and term_type = 'label'
ORDER bY term_entity_id
| {"resultsets": [{"headers": ["eigenschapnaam", "eigenschaplabel"], "rowcount": 1329}]} | null |
PSM article titles and their categories | null | USE enwikisource_p;
SELECT page.page_title, categorylinks.cl_to
FROM categorylinks INNER JOIN page
ON page.page_id = categorylinks.cl_from WHERE page.page_title LIKE
('Popular_Science_Monthly_Volume%') AND page.page_namespace = 0;
| {"resultsets": [{"headers": ["page_title", "cl_to"], "rowcount": 27111}]} | null |
Summer of Monuments WMDC cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wikipedia_Summer_of_Monuments")
AND r.rev_timestamp > 20140531200000
AND r.rev_timestamp < 20140930195959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 1206}]} | null |
WLM UK 2013 Cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2013_in_the_United_Kingdom")
AND r.rev_timestamp > 20130831230000
AND r.rev_timestamp < 20130930225959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 572}]} | null |
WLM Ukraine 2013 | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2013_in_Ukraine")
AND r.rev_timestamp > 20130831210000
AND r.rev_timestamp < 20140930205959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 585}]} | null |
WLM Thailand 2014 | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2014_in_Thailand")
AND r.rev_timestamp > 20140831170000
AND r.rev_timestamp < 20140930165900
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 122}]} | null |
WLM Switzerland 2013 | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2013_in_Switzerland")
AND r.rev_timestamp > 20130831220000
AND r.rev_timestamp < 20130930215959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 193}]} | null |
WLM Switzerland 2013 Cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2013_in_Switzerland")
AND r.rev_timestamp > 20130831220000
AND r.rev_timestamp < 20130930215959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 193}]} | null |
WLM Switzerland 2014 Cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2014_in_Switzerland")
AND r.rev_timestamp > 20140831220000
AND r.rev_timestamp < 20140930215959
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 97}]} | null |
WLM Serbia 2014 | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2014_in_Israel")
AND r.rev_timestamp > 20140923210000
AND r.rev_timestamp < 20141023210000
#7
AND r.rev_parent_id = 0; | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 383}]} | null |
WikiProject Medicine articles | null | select page_title from page where page_id in (select pl_from from pagelinks where pl_from_namespace=1 and pl_namespace=10 and pl_title="WikiProject_Medicine") order by rand() limit 300; | {"resultsets": [{"headers": ["page_title"], "rowcount": 300}]} | null |
Top 100 dewiki discussion pages by size | These pages are in namespace 1 and ordered by size. | USE dewiki_p;
SELECT page_title, page_len FROM page
WHERE page_namespace = 1
ORDER BY page_len DESC
LIMIT 100; | {"resultsets": [{"headers": ["page_title", "page_len"], "rowcount": 100}]} | null |
Quarry scheint nicht sortieren zu können! | null | USE dewiki_p;
SELECT user_id, user_name, user_editcount
FROM user
ORDER BY user_editcount DESC
LIMIT 100; | {"resultsets": [{"headers": ["user_id", "user_name", "user_editcount"], "rowcount": 100}]} | null |
Meisteditierte Artikel der letzten drei Tage | null | USE dewiki_p;
SELECT rc_title, COUNT(*) AS num_edits
FROM recentchanges
WHERE rc_namespace = 0
AND rc_timestamp > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 3 DAY),'%Y%m%d%H%i%s')
GROUP BY rc_title ORDER BY num_edits DESC
LIMIT 100; | {"resultsets": [{"headers": ["rc_title", "num_edits"], "rowcount": 100}]} | null |
Īsākās diskusiju lapas | null | #pielikt "no redirect"
USE lvwiki_p;
SELECT page_namespace,page_title,page_len FROM page
WHERE
#page_namespace = 1
(page_namespace <> 3) and
page_namespace % 2 =1
# AND LOWER(page_title) NOT LIKE "%/archive%"
# AND LOWER(page_title) NOT LIKE "%/Arhīvs%"
# AND LOWER(page_title) NOT LIKE "%/arhīvs%"
# AND LOWER(page_title) NOT LIKE "%/log%"
AND page_len < 30
# AND page_len > 30 and page_len < 60
ORDER BY page_len ASC; | {"resultsets": [{"headers": ["page_namespace", "page_title", "page_len"], "rowcount": 74}]} | null |
Subcategries info | null | USE enwiki_p;
SELECT * FROM categorylinks
WHERE cl_type = "subcat"
limit 100; | {"resultsets": [{"headers": ["cl_from", "cl_to", "cl_sortkey", "cl_timestamp", "cl_sortkey_prefix", "cl_collation", "cl_type"], "rowcount": 100}]} | null |
Hourly activity breakdown (since arbitrary date) | null | SELECT CONCAT(Hour, ':00-', Hour+1, ':00') AS Hours
, COUNT(rc_timestamp) AS `usage`
FROM recentchanges
RIGHT JOIN (
SELECT 0 AS Hour
UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3
UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6
UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9
UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12
UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15
UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18
UNION ALL SELECT 19 UNION ALL SELECT 20 UNION ALL SELECT 21
UNION ALL SELECT 22 UNION ALL SELECT 23
) AS AllHours ON HOUR(rc_timestamp) = Hour
WHERE rc_timestamp > 20150110215640
GROUP BY Hour
ORDER BY Hour | {"resultsets": [{"headers": ["Hours", "usage"], "rowcount": 24}]} | null |
Hourly anonymous article edit breakdown (since arbitrary date) | null | SELECT CONCAT(Hour, ':00-', Hour+1, ':00') AS Hours
, COUNT(rc_timestamp) AS `usage`
FROM itwiki_p.recentchanges
RIGHT JOIN (
SELECT 0 AS Hour
UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3
UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6
UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9
UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12
UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15
UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18
UNION ALL SELECT 19 UNION ALL SELECT 20 UNION ALL SELECT 21
UNION ALL SELECT 22 UNION ALL SELECT 23
) AS AllHours ON HOUR(rc_timestamp) = Hour
WHERE rc_timestamp > 20150122215640
AND rc_user = 0
AND rc_namespace=0
GROUP BY Hour
ORDER BY Hour | {"resultsets": [{"headers": ["Hours", "usage"], "rowcount": 24}]} | null |
Most edited English Wikipedia articles by links in past 3 days | null | USE enwiki_p;
SELECT rc_title, COUNT(*) AS num_edits -- ,
-- COUNT(DISTINCT pl.pl_from) as inbound_wikilinks
FROM recentchanges
-- JOIN pagelinks AS pl ON rc_title = pl.pl_title
-- AND pl.pl_namespace = 0
WHERE rc_namespace = 0
AND rc_timestamp > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 3 DAY),'%Y%m%d%H%i%s')
GROUP BY rc_title ORDER BY num_edits DESC
LIMIT 250; | {"resultsets": [{"headers": ["rc_title", "num_edits"], "rowcount": 250}]} | null |
WLM Russia 2014 Cohort | null | #1
SELECT DISTINCT rev_user_text, rev_user, cl_to
#2
FROM commonswiki_p.page p
#3
INNER JOIN commonswiki_p.categorylinks cl ON p.page_id = cl.cl_from
#4
INNER JOIN commonswiki_p.revision r ON p.page_id = r.rev_page
#5
WHERE p.page_namespace = 6
#6
AND cl.cl_to IN ("Images_from_Wiki_Loves_Monuments_2014_in_Russia")
AND r.rev_timestamp > 20141014210000
AND r.rev_timestamp < 20141115205900
#7
AND r.rev_parent_id = 0;
#LINE 1: declare which database fields (columns) you want to include in your output.
#You can include any fields from any of the tables you are joining (in this case: page, categorylinks, revision)
#LINE 2: declare which wiki you are pulling data from.
#In this case, commonswiki_p. You can find a full list here: https://tools.wmflabs.org/tools-info/?dblist=s1.labsdb
#LINE 3: join the page table with the categorylinks table on their COMMON KEY, which is the id of the page.
#LINE 4: join the page table with the revision table on their COMMON KEY, which is the id of the page.
#LINE 5: specify the numeric namespace(s) of the pages you want to get information for.
#There is a list of standard namespaces here: https://en.wikipedia.org/wiki/Wikipedia:Namespace
#LINE 6: specify the category(ies) that the pages are in. If you wanted to get pages from multipe categories,
#you would write the query the same way: AND cl.cl_to IN ("My_first_category", "Another_category")
#LINE 7: specify that you want to return the revision information from the FIRST revision to the page.
#the "parent" of a revision is the previous revision to that page.
#The first revision to a page doesn't have a "parent", so the value for rev_parent_id will be 0. | {"resultsets": [{"headers": ["rev_user_text", "rev_user", "cl_to"], "rowcount": 407}]} | null |
Most edited 50 nlwiki articles over the past week | null | USE nlwiki_p;
SELECT rc_title AS article, COUNT(*) AS num_edits
FROM recentchanges
WHERE rc_namespace = 0
AND rc_timestamp > DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), '%Y%m%d%H%i%s')
GROUP BY article ORDER BY num_edits DESC
LIMIT 50; | {"resultsets": [{"headers": ["article", "num_edits"], "rowcount": 50}]} | null |
Revision info | null | USE hewiki_p;
#SELECT page_id, page_title, rev_id, rev_comment, rev_user_text, rev_user, rev_timestamp, rev_parent_id
#FROM
#(SELECT * From page
# WHERE page_namespace = 0
# AND page_len > 1000
# AND page_is_redirect = 0) as page
#Inner Join
Select * From revision
WHERE rev_minor_edit = 0
AND rev_deleted = 0
AND rev_user NOT LIKE '%Bot'
#ON page_id = rev_page
#ORDER BY page_len ASC
LIMIT 100; | {"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": 100}]} | null |
Find first edits for articles with langlinks | null | SELECT page_id, page_title, rev_page, rev_id , rev_timestamp, rev_user_text, ll_title
FROM
(SELECT ll_from, ll_title FROM hewiki_p.langlinks
WHERE ll_lang ='en'
AND ll_title != "") as helinks
INNER JOIN
(SELECT * From hewiki_p.page
WHERE page_namespace = 0
AND page_len > 1000
AND page_is_redirect = 0) as page
ON ll_from = page.page_id
Inner Join
(Select rev_page, rev_id , rev_timestamp, rev_user_text From hewiki_p.revision
WHERE rev_minor_edit = 0
AND rev_deleted = 0
AND rev_user NOT LIKE '%Bot'
AND rev_parent_id = 0
) as revision
ON page_id = rev_page
#ORDER BY page_len ASC
LIMIT 100; | {"resultsets": [{"headers": ["page_id", "page_title", "rev_page", "rev_id", "rev_timestamp", "rev_user_text", "ll_title"], "rowcount": 100}]} | null |
recent changes to books in user space | null | SELECT rc_title AS title,
rc_id AS id,
rc_user AS user,
rc_timestamp as timestamp,
rc_comment
FROM recentchanges
WHERE rc_timestamp > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 DAY), '%Y%m%d%H%i%s')
AND rc_title like "%/Books/%"
AND rc_comment not like "%Created page %" | {"resultsets": [{"headers": ["title", "id", "user", "timestamp", "rc_comment"], "rowcount": 1250}]} | null |
Hebrew articles that are candidates to be a translation | Returns the "candidates" details - page id, page title, first revision in hebrew and in english | SELECT hepage_id, hepage_title, herev_id, he_timestamp, enpage_id, enpage_title,
revision2.rev_id as enrev_id, max_en_timestamp as en_timestamp FROM (
SELECT hepage_id, hepage_title, herev_id, he_timestamp, enpage_id, enpage_title, MAX(enrev_timestamp) as max_en_timestamp
FROM
(SELECT page_id as hepage_id, page_title as hepage_title, rev_id as herev_id, rev_timestamp as he_timestamp, ll_title
FROM
(SELECT ll_from, REPLACE(ll_title, ' ','_') as ll_title FROM hewiki_p.langlinks
WHERE ll_lang ='en'
AND ll_title != ""
LIMIT 100) as helang
INNER JOIN
(SELECT page_id, page_title FROM hewiki_p.page
WHERE page_namespace = 0
AND page_len > 1000
AND page_is_redirect = 0) as hepage
ON ll_from = page_id
INNER JOIN
(SELECT rev_page, rev_id, rev_timestamp FROM hewiki_p.revision
WHERE rev_minor_edit = 0
AND rev_deleted = 0
AND LCASE(rev_user) NOT LIKE '%bot%'
AND rev_parent_id = 0) as herevision
ON page_id = rev_page) as he_articles
Inner Join
(SELECT page_id as enpage_id, page_title as enpage_title, rev_timestamp as enrev_timestamp From enwiki_p.page
INNER JOIN enwiki_p.revision
ON page_id = rev_page
WHERE page_namespace = 0
AND rev_deleted = 0) as en_articles
ON ll_title = enpage_title
AND he_timestamp > enrev_timestamp
GROUP BY enpage_id) as filtered
INNER JOIN enwiki_p.revision as revision2
ON filtered.enpage_id = revision2.rev_page
AND filtered.max_en_timestamp = revision2.rev_timestamp
;
| {"resultsets": [{"headers": ["hepage_id", "hepage_title", "herev_id", "he_timestamp", "enpage_id", "enpage_title", "enrev_id", "en_timestamp"], "rowcount": 85}]} | null |
Ümbersuunamiste arutelulehed | Redirects with standalone talkpages | USE etwiki_p;
SELECT CONCAT('* [[Arutelu:', talk.page_title, ']]') as talkpage, talk.page_len
FROM page AS talk
JOIN page AS art
ON talk.page_title = art.page_title
WHERE
art.page_is_redirect = 1
AND art.page_namespace = 0
AND talk.page_namespace = 1
AND talk.page_is_redirect = 0
ORDER BY talk.page_len ASC; | {"resultsets": [{"headers": ["talkpage", "page_len"], "rowcount": 1597}]} | null |
Hewiki redirections to disambiguations | null | use hewiki_p;
select p1.page_title as 'הפניה', p2.page_title as 'פירושון' from page as p1 join redirect join page as p2 join page_props
on rd_namespace = 0 and p1.page_id = rd_from and p1.page_namespace = 0 and rd_title = p2.page_title and p2.page_id = pp_page
and pp_propname = "disambiguation";
SELECT DISTINCT pp_propname FROM page_props;
| {"resultsets": [{"headers": ["\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05e4\u05d9\u05e8\u05d5\u05e9\u05d5\u05df"], "rowcount": 2376}, {"headers": ["pp_propname"], "rowcount": 18}]} | null |
Feeling guilty | List own Commons uploads missing infobox template | USE commonswiki_p;
SELECT distinct(concat("*[[:File:",img_name,"]]")) as img_name, concat("<nowiki>",img_description,"</nowiki>") as img_description FROM image i
INNER JOIN page p ON p.page_title = i.img_name
INNER JOIN categorylinks c2 ON p.page_id = c2.cl_from AND (c2.cl_to = "Media_missing_infobox_template" OR c2.cl_to = "Files_with_no_machine-readable_source")
WHERE i.img_user_text = "Lokal Profil" | {"resultsets": [{"headers": ["img_name", "img_description"], "rowcount": 22}]} | null |
Most edited 20 enwiki articles over the past week | Copy this into a new query if it is out of date. Last run: 4 February 2015 | USE enwiki_p;
SELECT rc_title AS article, COUNT(*) AS num_edits
FROM recentchanges
WHERE rc_namespace = 0
AND rc_timestamp > DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), '%Y%m%d%H%i%s')
GROUP BY article ORDER BY num_edits DESC
LIMIT 20; | {"resultsets": [{"headers": ["article", "num_edits"], "rowcount": 20}]} | null |
Top 20 enwiki articles by distinct editors in past week | see https://en.wikipedia.org/wiki/Wikipedia_talk:Wikipedia_Signpost/2015-01-28/From_the_editor
Copy to a new query if this one is out of date. Last run: 4 February 2015 | USE enwiki_p;
SELECT rc_title AS article, COUNT(DISTINCT rc_user) AS num_editors
FROM recentchanges
WHERE rc_namespace = 0
AND rc_timestamp > DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), '%Y%m%d%H%i%s')
GROUP BY article ORDER BY num_editors DESC
LIMIT 20; | {"resultsets": [{"headers": ["article", "num_editors"], "rowcount": 20}]} | null |
Namespaces | null | USE hewiki_p;
SELECT page_title AS 'from',
CASE page_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה" WHEN 829 THEN "שיחת יחידה" ELSE "אחרים" END AS 'from ns',
rd_title AS 'to',
CASE rd_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה" WHEN 829 THEN "שיחת יחידה" ELSE "אחרים" END AS 'to ns'
FROM page
JOIN redirect ON redirect.rd_from = page.page_id
WHERE page.page_namespace <> 0
AND NOT page_namespace = rd_namespace
AND NOT (page_namespace = 2 AND rd_namespace = 0)
AND NOT (page_namespace = 4 AND rd_namespace = 0)
AND NOT (page_namespace = 12 AND rd_namespace = 0)
AND NOT (page_namespace = 1 AND rd_namespace = 1)
AND NOT (page_namespace = 14 AND rd_namespace = 0)
AND NOT (page_namespace = 4 AND rd_namespace = -1)
AND NOT (page_namespace = 12 AND rd_namespace = 4)
AND NOT (page_namespace = 100 AND rd_namespace = 4)
AND NOT (page_namespace = 4 AND rd_namespace = 5)
AND NOT page_namespace = 3
AND NOT page_namespace = 2
AND NOT (rd_title LIKE "User:%" AND page_namespace = 2)
AND NOT (rd_title LIKE "user:%" AND page_namespace = 2)
AND NOT (rd_title LIKE "en:user:%" AND page_namespace = 2)
AND NOT (rd_title LIKE "User_talk:%" AND page_namespace = 3)
AND NOT (rd_title LIKE "User_talk:%" AND page_namespace = 2)
AND NOT (page_namespace = 10) #to be fixed
AND NOT (page_namespace = 4) #to be fixed | {"resultsets": [{"headers": ["from", "from ns", "to", "to ns"], "rowcount": 62}]} | null |
From template to anothers | null | USE hewiki_p;
SELECT page_title AS 'from',
CASE page_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה" WHEN 829 THEN "שיחת יחידה" ELSE "אחרים" END AS 'from ns',
rd_title AS 'to',
CASE rd_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה" WHEN 829 THEN "שיחת יחידה" ELSE "אחרים" END AS 'to ns'
FROM page
JOIN redirect ON redirect.rd_from = page.page_id
WHERE page.page_namespace = 10
AND NOT page_namespace = rd_namespace | {"resultsets": [{"headers": ["from", "from ns", "to", "to ns"], "rowcount": 588}]} | null |
Grants Namespace edits WMF | null | #edits to the evaluation portal
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 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")) #not a non-standard staff account OR User:FuzzyBot
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC;
#unique editors to the evaulation portal
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 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")) #not a non-standard staff account OR User:FuzzyBot
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["year", "month", "edits"], "rowcount": 17}, {"headers": ["year", "month", "editors"], "rowcount": 17}]} | null |
Grants namespace edits and editors (non-WMF) | null | #edits to the grants namespace by non-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 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND r.rev_timestamp > 20131001000000
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 non-WMF editors to the grants namespace
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 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND r.rev_timestamp > 20131001000000
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 Grants namespacy by WMF editors
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 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND r.rev_timestamp > 20131001000000
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", "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 WMF editors in the Grants namespace
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 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_user != 0 #exclude IP edits and editorsAND r.rev_timestamp > 20141001000000
AND r.rev_timestamp > 20131001000000
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", "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;
| {"resultsets": [{"headers": ["year", "month", "edits"], "rowcount": 17}, {"headers": ["year", "month", "editors"], "rowcount": 17}, {"headers": ["year", "month", "edits"], "rowcount": 17}, {"headers": ["year", "month", "editors"], "rowcount": 17}]} | null |
Grants:Evaluation edits | null | #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 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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "Evaluation%"
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", "FuzzyBot", "Wolliff") #not a non-standard staff account OR User:FuzzyBot
AND r.rev_timestamp > 20131001000000
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC;
#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 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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "Evaluation%"
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", "FuzzyBot", "Wolliff") #not a non-standard staff account OR User:FuzzyBot
AND r.rev_timestamp > 20131001000000
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 editsWMF 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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "Evaluation%"
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")) #not a non-standard staff account OR User:FuzzyBot
AND r.rev_timestamp > 20131001000000
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 editorsWMF 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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "Evaluation%"
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")) #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"], "rowcount": 17}, {"headers": ["year", "month", "editors"], "rowcount": 17}, {"headers": ["year", "month", "editsWMF"], "rowcount": 17}, {"headers": ["year", "month", "editorsWMF"], "rowcount": 17}]} | null |
IdeaLab ideas by month | null | #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
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_parent_id = 0
AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account
AND r.rev_user_text NOT IN ("Ijon", "FuzzyBot", "Wolliff") #not a non-standard staff account OR User:FuzzyBot
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_parent_id = 0
AND (r.rev_user_text LIKE "%(WMF)" #not a standard staff account
OR r.rev_user_text IN ("Ijon", "FuzzyBot", "Wolliff")) #not a non-standard staff account OR User:FuzzyBot
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC;
| {"resultsets": [{"headers": ["year", "month", "ideas_created"], "rowcount": 24}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 9}]} | null |
Idea lab ideas created per month | null | #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", "FuzzyBot", "Wolliff") #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;
#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")) #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;
#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 r.rev_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "IdeaLab%"
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", "FuzzyBot", "Wolliff") #not a non-standard staff account OR User:FuzzyBot
AND r.rev_timestamp > 20131001000000
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 r.rev_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "IdeaLab%"
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")) #not a non-standard staff account OR User:FuzzyBot
AND r.rev_timestamp > 20131001000000
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC;
#unique editors 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(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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "IdeaLab%"
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", "FuzzyBot", "Wolliff") #not a non-standard staff account OR User:FuzzyBot
AND r.rev_timestamp > 20131001000000
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_user != 0 #exclude IP edits and editors
AND p.page_title LIKE "IdeaLab%"
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")) #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", "ideas_created_by_Community"], "rowcount": 24}, {"headers": ["year", "month", "ideas_created_WMF"], "rowcount": 9}, {"headers": ["year", "month", "edits_community"], "rowcount": 17}, {"headers": ["year", "month", "edits_WMF"], "rowcount": 17}, {"headers": ["year", "month", "editors_community"], "rowcount": 17}, {"headers": ["year", "month", "editors_WMF"], "rowcount": 17}]} | null |
Learning Patterns by WMF and non-WMF | null | #count Learning patterns created per month by non-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 learning_patterns_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)" #not a standard staff account
AND r.rev_user_text NOT 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;
#Total Learning 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 learning_patterns_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 cl.cl_to IN ("Learning_patterns")
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", "learning_patterns_by_Community"], "rowcount": 15}, {"headers": ["year", "month", "learning_patterns_by_WMF"], "rowcount": 17}]} | null |
IEG proposals | null | #count IdeaLab ideas created per month
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 grant_proposals
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 p.page_title LIKE "IEG%"
AND cl.cl_to IN ("IEG_2014_round_1", "IEG_2014_round_2", "IEG_2013_round2")
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["year", "month", "grant_proposals"], "rowcount": 14}]} | null |
PEG | null | #count PEG submissions created per month
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 grant_proposals
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 p.page_title LIKE "PEG%"
AND cl.cl_to IN ("WMF_grants_funded_in_FY_2014-15","WMF_grants_funded_in_FY_2013-14","WMF_grant_submissions","WMF_grant_submissions_not_funded","Withdrawn_WMF_grant_submissions","Funded_and_cancelled_WMF_grants")
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["year", "month", "grant_proposals"], "rowcount": 45}]} | null |
APG proposals | null | #count PEG submissions created per month
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 grant_proposals
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 p.page_title LIKE "APG%Proposal_form"
AND p.page_title NOT LIKE "Proposal_form/"
AND cl.cl_to IN ("Annual_plan_grants_and_proposals_for_2013-2014_Round_1", "Annual_plan_grants_and_proposals_for_2013-2014_Round_2","Annual_plan_grants_and_proposals_for_2014-2015_Round_1")
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC; | {"resultsets": [{"headers": ["year", "month", "grant_proposals"], "rowcount": 7}]} | null |
Exemple of query for the size of a Category | Size of a category | -- Selecting Wikimedia Commons Database
USE commonswiki_p;
-- Parameter of the query (Category to look for)
SET @cat = "Images_by_PierreSelim";
SELECT /* SLOW_OK */
SUM(image.img_height*image.img_width) AS total_size
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 = @cat
; | {"resultsets": [{"headers": ["total_size"], "rowcount": 1}]} | null |
Enwiki accounts by age and editcount | null | USE enwiki_p;
SELECT
user.user_id, user.user_registration, user.user_editcount, recentchanges.rc_user, recentchanges.rc_timestamp
FROM
user INNER JOIN recentchanges
ON recentchanges.rc_user = user.user_id
WHERE
user.user_registration < 20141001000000
AND user.user_editcount >= 1000
; | {"resultsets": [{"headers": ["user_id", "user_registration", "user_editcount", "rc_user", "rc_timestamp"], "rowcount": 2802483}]} | null |
en wiki accounts created after July 2014 w/> 2000 edits | null | SELECT * FROM user where user_registration > 20140700000000 AND user_editcount > 2000; | {"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": 52}]} | null |
QI supported by WMFR (2013-2014) | Quality images supported by Wikimedia France (2013-2014) | USE commonswiki_p;
SELECT /* SLOW_OK */ COUNT(*)
FROM
(SELECT /* SLOW_OK */ page.page_title
FROM image
CROSS JOIN page ON image.img_name = page.page_title
CROSS JOIN categorylinks ON page.page_id = categorylinks.cl_from
CROSS JOIN categorylinks c2 ON page.page_id = c2.cl_from
LEFT JOIN oldimage ON image.img_name = oldimage.oi_name AND oldimage.oi_timestamp = (SELECT MIN(o.oi_timestamp) FROM oldimage o WHERE o.oi_name = image.img_name)
WHERE
categorylinks.cl_to = "Media_supported_by_Wikimedia_France"
AND IF(oldimage.oi_timestamp IS NULL, img_timestamp, oldimage.oi_timestamp) BETWEEN 20140701000000 AND 20150701000000
AND (c2.cl_to = "Quality_images")
GROUP BY page.page_title
ORDER BY img_timestamp ASC) labels; | {"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]} | null |
Featured pictures from Wiki Loves Monuments 2014 in France | null | USE commonswiki_p;
SELECT /* SLOW_OK */ COUNT(image.img_name)
FROM image
CROSS JOIN page ON image.img_name = page.page_title
CROSS JOIN categorylinks ON page.page_id = categorylinks.cl_from
CROSS JOIN categorylinks c2 ON page.page_id = c2.cl_from
WHERE
categorylinks.cl_to = "Images_from_Wiki_Loves_Monuments_2014_in_France"
AND c2.cl_to = "Featured_pictures_on_Wikimedia_Commons"
; | {"resultsets": [{"headers": ["COUNT(image.img_name)"], "rowcount": 1}]} | null |
Valued Images from Wiki Loves Monuments 2014 in France | null | USE commonswiki_p;
SELECT /* SLOW_OK */ COUNT(image.img_name)
FROM image
CROSS JOIN page ON image.img_name = page.page_title
CROSS JOIN categorylinks ON page.page_id = categorylinks.cl_from
CROSS JOIN categorylinks c2 ON page.page_id = c2.cl_from
WHERE
categorylinks.cl_to = "Images_from_Wiki_Loves_Monuments_2014_in_France"
AND c2.cl_to = "Valued_images_sorted_by_promotion_date"
; | {"resultsets": [{"headers": ["COUNT(image.img_name)"], "rowcount": 1}]} | null |
False articles in tewiki | null | SELECT concat("# [[",page_title,"]]") AS page_title, page_len
FROM tewiki_p.page
WHERE page_is_redirect=1 AND page_namespace=0 AND page_len > 200; | {"resultsets": [{"headers": ["page_title", "page_len"], "rowcount": 257}]} | null |
List of rowiktionary users by number of edits (excl. bots) | null | USE rowiktionary_p;
SELECT user_name,
user_editcount
FROM user
WHERE user_id NOT IN /* Exclude local bots. */
(SELECT ug_user
FROM user_groups
WHERE ug_group="bot")
AND user_name NOT IN
(SELECT gu_name
FROM centralauth_p.globaluser JOIN centralauth_p.localuser ON lu_name=gu_name AND lu_wiki="rowiktionary"
JOIN centralauth_p.global_user_groups ON gug_user=gu_id
WHERE gug_group="global-bot")
ORDER BY user_editcount DESC LIMIT 100; | {"resultsets": [{"headers": ["user_name", "user_editcount"], "rowcount": 100}]} | null |
Files with meaningless names on rowiki | null | USE rowiki_p;
SELECT CONCAT('#[[:File:',page.page_title,']]')
AS Filename FROM page
WHERE page.page_title
REGEXP '^[0-9_-]+.jp[e]?g' LIMIT 100; | {"resultsets": [{"headers": ["Filename"], "rowcount": 14}]} | null |
wikimedia stewards election eligibility stats - editors who have > 600 edits on en | based on SQL from PiRSquared17 | USE enwiki_p;
SELECT COUNT(*)
FROM user
WHERE user_editcount > 600
AND user_id NOT IN /* Exclude local bots. */
(SELECT ug_user
FROM user_groups
WHERE ug_group="bot")
AND user_name NOT IN
(SELECT gu_name
FROM centralauth_p.globaluser JOIN centralauth_p.localuser ON lu_name=gu_name AND lu_wiki="enwiki"
JOIN centralauth_p.global_user_groups ON gug_user=gu_id
WHERE gug_group="global-bot"); | {"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]} | null |
Byte Change | 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": 8628}]} | null |
recent edits for user 24902 | null | SELECT COUNT(*)
FROM enwiki_p.revision_userindex
WHERE rev_user = 24902
AND rev_timestamp >= 20140801000000;
| {"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]} | null |
Patrollers on Wikidata | Wikidata users per number of patrol edits since 2015/1/1 | USE wikidatawiki_p;
SELECT log_user_text, COUNT(*)
FROM logging
WHERE
log_action='patrol'
AND log_params LIKE '%\"6::auto\";i:0%'
AND log_timestamp>20150101000000
GROUP BY log_user_text; | {"resultsets": [{"headers": ["log_user_text", "COUNT(*)"], "rowcount": 126}]} | null |
Random sample of recent ptwiki edits | null | USE ptwiki_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 |
Double file extensions on rowiki | null | USE rowiki_p;
SELECT CONCAT("# {{/link|File:", REPLACE(REPLACE(page_title, "_", " "), "=", "="), "}}") AS Filename
FROM page
WHERE page_namespace=6 AND page_is_redirect=0
AND CONVERT(page_title USING utf8) REGEXP "\\.(djvu|gif|jpeg|jpg|flac|mid|wav|ogg|oga|ogv|pdf|png|svg|tif[^f]|tiff|xcf|webm)."
AND CONVERT(page_title USING utf8) NOT REGEXP "/|\\.webm[sh]d\\.webm$|\\.oggtheora\\.og[agv]$|\\.oggvorbis\\.ogg$"
ORDER BY
CONVERT(page_title USING utf8) REGEXP "\\.(djvu|gif|jpe?g|flac|mid|wav|og[agv]|pdf|png|svg|tiff?|xcf|webm)[^[:alpha:]]" DESC,
page_title REGEXP "\\.[[:alpha:]]{3,4}\\.[[:alpha:]]{3,4}$" DESC,
LENGTH(page_title)>24 AND LOCATE(".", REVERSE(page_title), 6) > 16,
BINARY page_title; | {"resultsets": [{"headers": ["Filename"], "rowcount": 72}]} | null |
Quality images from Wiki Loves Monuments 2014 in France | null | USE commonswiki_p;
SELECT /* SLOW_OK */ COUNT(image.img_name)
FROM image
CROSS JOIN page ON image.img_name = page.page_title
CROSS JOIN categorylinks ON page.page_id = categorylinks.cl_from
CROSS JOIN categorylinks c2 ON page.page_id = c2.cl_from
WHERE
categorylinks.cl_to = "Images_from_Wiki_Loves_Monuments_2014_in_France"
AND c2.cl_to = "Quality_images"
; | {"resultsets": [{"headers": ["COUNT(image.img_name)"], "rowcount": 1}]} | null |
Sleeping users | null | SELECT count(DISTINCT u.user_id) as TotalUsers FROM svwiki_p.user u
JOIN svwiki_p.user_groups ug ON u.user_id=ug.ug_user
JOIN svwiki_p.user_properties up ON u.user_id=up.up_user
WHERE u.user_id IN (SELECT r.rev_user FROM svwiki_p.revision r WHERE r.rev_timestamp>20141030000000)
AND up.up_property="gender" AND up.up_value="female"
AND ug.ug_group<>'bot' | {"resultsets": [{"headers": ["TotalUsers"], "rowcount": 1}]} | null |
Remaining interwikilinks dewiki | null | USE dewiki_p;
SELECT page.page_title, CONCAT(iwlinks.iwl_prefix, ":", iwlinks.iwl_title)
FROM page, iwlinks
WHERE iwlinks.iwl_from = page.page_id
AND iwlinks.iwl_title <> ""
AND iwlinks.iwl_prefix NOT IN ("als", "ar", "ang")
AND page.page_namespace = 0
LIMIT 100; | {"resultsets": [{"headers": ["page_title", "CONCAT(iwlinks.iwl_prefix, \":\", iwlinks.iwl_title)"], "rowcount": 100}]} | null |
Block logs of 2014 in FaWP | null | USE fawiki_p;
SELECT log_user_text, log_title, log_params
FROM logging
WHERE log_type='block' AND log_params <> ''
AND log_timestamp > '20140101' AND log_timestamp < '20150101'
AND log_params NOT LIKE 'in%nit%' -- I don't care about infinite/indefinite blocks
AND log_user <> 427882 -- I don't care about blocks by AbuseFilter
AND log_title NOT REGEXP '[0-9]+\.[0-9]+\.' -- no IP blocks
AND
(log_params LIKE '%year%' OR log_params LIKE '%month%' OR log_params LIKE '%week%' OR log_params LIKE '%day%')
ORDER BY log_user_text, log_params; | {"resultsets": [{"headers": ["log_user_text", "log_title", "log_params"], "rowcount": 344}]} | null |
Commons DjVu in use coming from archive.org | A query by Dispenser | USE commonswiki_p;
SELECT /*SLOW_OK*/
CONCAT("[[:File:", REPLACE(img_name, "_", " "), "]]") AS "File",
el_from,
img_size,
REPLACE(img_user_text, "_", " ") AS "Uploader",
img_timestamp AS "Timestamp",
el_to,
(SELECT COUNT(*) FROM globalimagelinks WHERE gil_to=page_title) AS "Usage",
(SELECT COUNT(*) FROM oldimage WHERE oi_name=page_title) AS "Reuploads",
SUBSTRING_INDEX(el_to,"/",-1) AS "Archive_Name"
FROM image
JOIN page ON page_namespace=6 AND page_title=CONVERT(img_name USING latin1)
JOIN externallinks ON el_from=page_id
WHERE img_media_type="BITMAP"
AND img_major_mime="image" AND img_minor_mime="vnd.djvu"
AND (el_index LIKE "http://org.archive.%/details/_%"
OR el_index LIKE "https://org.archive.%/details/_%");
| {"resultsets": [{"headers": ["File", "el_from", "img_size", "Uploader", "Timestamp", "el_to", "Usage", "Reuploads", "Archive_Name"], "rowcount": 15438}]} | null |
Page Links | null | SELECT * from cawiki_p.pagelinks as pl
WHERE pl.pl_from = 1111934
AND pl.pl_from_namespace = 102
; | {"resultsets": [{"headers": ["pl_from", "pl_namespace", "pl_title", "pl_from_namespace"], "rowcount": 1386}]} | null |
Active image reviewers who are not in OTRS | Image reviewers who are not in OTRS.
Derived from https://quarry.wmflabs.org/query/1941 | USE commonswiki_p;
SELECT user_name, user_editcount, count(*) as num_reviews_in_RC
FROM user
JOIN recentchanges_userindex ON user_id = rc_user
WHERE user_editcount > 10
AND user_id IN /* Include local non-bot image reviewers only. */
(SELECT ug_user
FROM user_groups
WHERE ug_group="Image-reviewer" OR ug_group="sysop")
AND user_id NOT IN
(SELECT ug_user
FROM user_groups
WHERE ug_group="bot")
AND user_name NOT IN
(SELECT gu_name
FROM centralauth_p.globaluser JOIN centralauth_p.localuser ON lu_name=gu_name AND lu_wiki="commonswiki"
JOIN centralauth_p.global_user_groups ON gug_user=gu_id
WHERE gug_group="OTRS-member")
AND rc_comment LIKE "%License review%"
GROUP BY user_id
; | {"resultsets": [{"headers": ["user_name", "user_editcount", "num_reviews_in_RC"], "rowcount": 38}]} | null |
Page namespace pages created in Telugu Wikisource in given month | Page namespace pages created in Telugu Wikisource in given month | use orwikisource_p;
select count(*) as Oct14 from page, revision where rev_page = page_id and rev_parent_id = 0 and page_namespace = 250 and rev_timestamp <= 20141100000000 and rev_timestamp > 20141000000000;
select count(*) as Nov14 from page, revision where rev_page = page_id and rev_parent_id = 0 and page_namespace = 250 and rev_timestamp <= 20141200000000 and rev_timestamp > 20141100000000;
select count(*) as Dec14 from page, revision where rev_page = page_id and rev_parent_id = 0 and page_namespace = 250 and rev_timestamp <= 20150100000000 and rev_timestamp > 20141200000000;
| {"resultsets": [{"headers": ["Oct14"], "rowcount": 1}, {"headers": ["Nov14"], "rowcount": 1}, {"headers": ["Dec14"], "rowcount": 1}]} | null |
ردههایی که «غیر» به واژه پس از خود چسبیده است | null | USE fawiki_p;
SELECT `page_title` FROM `page` WHERE `page_namespace` = 14 AND `page_title` REGEXP '[^\w]غیر[^_]' AND `page_is_redirect` = 0; | {"resultsets": [{"headers": ["page_title"], "rowcount": 106}]} | null |
Editor gender on English Wikipedia | Declared gender of en:wiki users. | SELECT count(user_name) AS Masc, (SELECT count(user_name) FROM enwiki_p.user
JOIN enwiki_p.user_properties ON up_user = user_id
WHERE up_property = 'gender' AND up_value = 'female') AS Femin
FROM enwiki_p.user
JOIN enwiki_p.user_properties ON up_user = user_id
WHERE up_property = 'gender' AND up_value = 'male'
# derived from http://quarry.wmflabs.org/query/669 by Lijealso, with thanks. | {"resultsets": [{"headers": ["Masc", "Femin"], "rowcount": 1}]} | null |
نوشتارهای «ایالات متحده» که باید به «ایالات متحده آمریکا» منتقل شوند. | null | USE fawiki_p;
SELECT `page_title` FROM `page` WHERE `page_namespace` = 10 AND (`page_title` LIKE '%ایالات_متحده%' AND `page_title` NOT LIKE '%ایالات_متحده_آمریکا%') AND `page_is_redirect` = 0; | {"resultsets": [{"headers": ["page_title"], "rowcount": 59}]} | null |
Alevi draft | null | use hewiki_p;
select page_namespace, page_title, el_to, el_index from page join externallinks
on page_id = el_id
and exists
(select * from templatelinks
where tl_from = page_id
and (tl_title="בבלי" or tl_title="" or tl_title="זוהר" or tl_title="טור" or tl_title="ירושלמי"
or tl_title="משנה" or tl_title='רמב"ם' or tl_title="שולחן_ערוך" or tl_title='תנ"ך'))
| {"resultsets": [{"headers": ["page_namespace", "page_title", "el_to", "el_index"], "rowcount": 2545}]} | null |
large user talk pages | 1358 | use rowiki_p;
SELECT
page_title, page_touched, page_len
FROM
page
WHERE
page_len > 200000
AND page_namespace=3
AND page_title NOT LIKE '%/%'; | {"resultsets": [{"headers": ["page_title", "page_touched", "page_len"], "rowcount": 11}]} | null |
Hewiki articles without category | null | use hewiki_p;
select page_title from page
where page_namespace = 0
and page_is_redirect = 0
and page_id not in
(select distinct cl_from from categorylinks
where not cl_to like "קצרמר%"
and not (cl_to like "ויקיפדיה:%" and not cl_to = "ויקיפדיה:_ערכים_בעבודה"))
and page_id < 1245567;
select * from page where page_namespace = 0 and page_title = "מריאן_הירש" | {"resultsets": [{"headers": ["page_title"], "rowcount": 172}, {"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": 1}]} | null |
All enwiki users with "example" in username | null | use enwiki_p;
SELECT
user_name
FROM
user
WHERE
user_name LIKE '%example%'
OR user_name LIKE '%Example%' ; | {"resultsets": [{"headers": ["user_name"], "rowcount": 225}]} | null |
New Users | null | SELECT count(*)
FROM commonswiki_p.revision
JOIN commonswiki_p.page
ON rev_page = page_id
WHERE rev_parent_id = 0
AND revision.rev_timestamp > 20121022000000
AND revision.rev_timestamp <= 20121022010000
LIMIT 10 | {"resultsets": [{"headers": ["count(*)"], "rowcount": 1}]} | null |
Number of redirects in main namespace on rowiki | null | use rowiki_p;
select COUNT(*) from page
where page_namespace = 0
and page_is_redirect = 1; | {"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]} | null |
Test query | null | SELECT CONCAT("* [[", REPLACE(page.page_title, "_", " "), "]]") AS pages
FROM templatelinks
JOIN page ON page.page_id=tl_from AND page.page_namespace=0
JOIN pagelinks ON pl_from=tl_from
JOIN page AS pl ON pl.page_namespace=pl_namespace AND pl.page_title=pl_title
LEFT JOIN redirect ON rd_from=pl.page_id
LEFT JOIN page AS rd ON rd.page_namespace=rd_namespace AND rd.page_title=rd_title
LEFT JOIN page_props ON pp_page=IFNULL(rd.page_id,pl.page_id) AND pp_propname="disambiguation"
WHERE tl_namespace=10 AND tl_title="Disambiguation_needed" AND pl_namespace=0
GROUP BY tl_from
HAVING COUNT(*)=SUM(pp_page IS NULL); | {"resultsets": [{"headers": ["pages"], "rowcount": 1517}]} | null |
Users who used AFCH in February 2015 | null | select distinct concat("# [[User:",rev_user_text,"]]") as `username` from revision where
(select page_namespace from page where page_id=revision.rev_page) in (118,5) -- Draft: and Wikipedia talk:
and rev_comment regexp 'AFCH' -- AFCH
and rev_timestamp > 20150200000000 -- February 2015
order by rev_timestamp desc limit 100; | {"resultsets": [{"headers": ["username"], "rowcount": 100}]} | null |
Hewiki suspicious redirections | null | USE hewiki_p;
# page - from, rd - to
SELECT
CASE page_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 108 THEN "ספר" WHEN 109 THEN "שיחת ספר" WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה"
WHEN 829 THEN "שיחת יחידה" ELSE page_namespace END AS 'מרחב ההפניה',
CASE rd_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 108 THEN "ספר" WHEN 109 THEN "שיחת ספר" WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה"
WHEN 829 THEN "שיחת יחידה" ELSE rd_namespace END AS 'מרחב היעד'
FROM page
JOIN redirect ON rd_from = page_id
WHERE page_namespace <> rd_namespace
AND NOT (((page_title LIKE "וק:%") OR (page_title LIKE "WP:%"))
AND page_namespace = 0 AND (rd_namespace = 4 OR rd_namespace = -1 OR rd_namespace = 8 Or rd_namespace = 12)) # shortcuts
AND NOT (page_namespace = 4 AND (page_title LIKE 'מיזמי_ויקיפדיה/%') AND rd_namespace = 0) # wikipedia projects to articles
AND NOT (page_namespace = 4 AND rd_namespace = -1) # wikipedia to special
AND NOT (page_namespace = 0 AND page_title = 'Wikipedia_embassy') # 'embassy'
AND NOT (page_namespace = 4 AND rd_namespace = 5) # wikipedia to wilipedia talk
AND NOT (page_namespace = 4 AND rd_namespace = 12) # wikipedia to help
AND NOT (page_namespace = 5 AND rd_namespace = 13) # wikipedia talk to help talk
AND NOT (page_namespace = 4 AND rd_namespace = 100) # wikipedia to portal
AND NOT (page_namespace = 5 AND rd_namespace = 101) # wikipedia talk to portal talk
AND NOT (page_namespace = 2 OR page_namespace = 3) # from user and user talk
AND NOT (page_namespace = 12 AND rd_namespace = 4) # help to wikipedia
AND NOT (page_namespace = 12 AND rd_namespace = 9) # help to media wiki talk
AND NOT (page_namespace = 100 AND rd_namespace = 4) # portal to wikipedia
AND NOT (page_namespace = 4 AND rd_namespace = 8) # wikipedia to media wiki
AND NOT (page_namespace = 5 AND rd_namespace = 9) # wikipedia talk to media wiki talk
AND NOT (page_namespace = 9 AND rd_namespace = 12) # media wiki talk to help talk
AND NOT (page_namespace = 0 AND rd_namespace = 14) # articles to category
AND NOT (page_namespace = 0 AND rd_namespace = 100) # articles to portal
AND NOT (page_namespace = 10 AND rd_namespace = 100) # template to portal
AND NOT (page_namespace = 11 AND rd_namespace = 101) # template talk to portal talk
GROUP BY page_namespace, rd_namespace;
SELECT
CASE page_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 108 THEN "ספר" WHEN 109 THEN "שיחת ספר" WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה"
WHEN 829 THEN "שיחת יחידה" ELSE page_namespace END AS 'מרחב ההפניה', page_title AS 'שם ההפניה',
CASE rd_namespace WHEN -2 THEN "מדיה" WHEN -1 THEN "מיוחד" WHEN 0 THEN ":" WHEN 1 THEN "שיחה" WHEN 2 THEN "משתמש"
WHEN 3 THEN "שיחת משתמש" WHEN 4 THEN "ויקיפדיה" WHEN 5 THEN "שיחת ויקיפדיה" WHEN 6 THEN "קובץ" WHEN 7 THEN "שיחת קובץ"
WHEN 8 THEN "מדיה ויקי" WHEN 9 THEN "שיחת מדיה ויקי" WHEN 10 THEN "תבנית" WHEN 11 THEN "שיחת תבנית" WHEN 12 THEN "עזרה"
WHEN 13 THEN "שיחת עזרה" WHEN 14 THEN "קטגוריה" WHEN 15 THEN "שיחת קטגוריה" WHEN 100 THEN "פורטל" WHEN 101 THEN "שיחת פורטל"
WHEN 108 THEN "ספר" WHEN 109 THEN "שיחת ספר" WHEN 118 THEN "טיוטה" WHEN 119 THEN "שיחת טיוטה" WHEN 828 THEN "יחידה"
WHEN 829 THEN "שיחת יחידה" ELSE rd_namespace END AS 'מרחב היעד', rd_title AS 'שם היעד'
FROM page
JOIN redirect ON rd_from = page_id
WHERE page_namespace <> rd_namespace
AND NOT (((page_title LIKE "וק:%") OR (page_title LIKE "WP:%"))
AND page_namespace = 0 AND (rd_namespace = 4 OR rd_namespace = -1 OR rd_namespace = 8 Or rd_namespace = 12)) # shortcuts
AND NOT (page_namespace = 4 AND (page_title LIKE 'מיזמי_ויקיפדיה/%') AND rd_namespace = 0) # wikipedia projects to articles
AND NOT (page_namespace = 0 AND rd_namespace = 100) # articles to portal
AND NOT (page_namespace = 0 AND page_title = 'Wikipedia_embassy') # 'embassy'
AND NOT (page_namespace = 4 AND rd_namespace = 5) # wikipedia to wilipedia talk
AND NOT (page_namespace = 4 AND rd_namespace = 12) # wikipedia to help
AND NOT (page_namespace = 5 AND rd_namespace = 13) # wikipedia talk to help talk
AND NOT (page_namespace = 4 AND rd_namespace = 100) # wikipedia to portal
AND NOT (page_namespace = 5 AND rd_namespace = 101) # wikipedia talk to portal talk
AND NOT (page_namespace = 2 OR page_namespace = 3) # from user and user talk
AND NOT (page_namespace = 12 AND rd_namespace = 4) # help to wikipedia
AND NOT (page_namespace = 12 AND rd_namespace = 9) # help to media wiki talk
AND NOT (page_namespace = 100 AND rd_namespace = 4) # portal to wikipedia
AND NOT (page_namespace = 4 AND rd_namespace = 8) # wikipedia to media wiki
AND NOT (page_namespace = 5 AND rd_namespace = 9) # wikipedia talk to media wiki talk
AND NOT (page_namespace = 9 AND rd_namespace = 12) # media wiki talk to help talk
AND NOT (page_namespace = 4 AND rd_namespace = -1) # wikipedia to special
AND NOT (page_namespace = 0 AND rd_namespace = 14) # articles to category
AND NOT (page_namespace = 10 AND rd_namespace = 100) # template to portal
AND NOT (page_namespace = 11 AND rd_namespace = 101) # template talk to portal talk
| {"resultsets": [{"headers": ["\u05de\u05e8\u05d7\u05d1 \u05d4\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05de\u05e8\u05d7\u05d1 \u05d4\u05d9\u05e2\u05d3"], "rowcount": 25}, {"headers": ["\u05de\u05e8\u05d7\u05d1 \u05d4\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05e9\u05dd \u05d4\u05d4\u05e4\u05e0\u05d9\u05d4", "\u05de\u05e8\u05d7\u05d1 \u05d4\u05d9\u05e2\u05d3", "\u05e9\u05dd \u05d4\u05d9\u05e2\u05d3"], "rowcount": 74}]} | null |
page_id | null | SELECT * from enwiki_p.pagelinks as pl WHERE pl.pl_from = 10261194 AND pl.pl_from_namespace = 4 AND (pl.pl_namespace = 0 OR pl.pl_namespace = 1); | {"resultsets": [{"headers": ["pl_from", "pl_namespace", "pl_title", "pl_from_namespace"], "rowcount": 867}]} | null |
Daily anonymous mobile edits from Italian Wikipedia | See http://quarry.wmflabs.org/query/1242 and https://meta.wikimedia.org/wiki/Research:Anonymous_mobile_editing_in_Italian_Wikipedia | /* Forked from http://quarry.wmflabs.org/query/948 */
USE itwiki_p;
SELECT
LEFT(rev_timestamp, 8) AS date,
COUNT(*)
FROM revision_userindex
INNER JOIN tag_summary ON
ts_rev_id = rev_id AND
ts_tags LIKE "%mobile web edit%"
WHERE
rev_timestamp BETWEEN "20141101" AND "20150225" AND
rev_user = 0
GROUP BY date; | {"resultsets": [{"headers": ["date", "COUNT(*)"], "rowcount": 105}]} | null |
Users with >5 edits in December 2014 on Swedish Wikipedia | Incl anonymous edits | USE svwiki_p;
SELECT distinct r.rev_user, count(r.rev_id) FROM revision r JOIN page p ON r.rev_page=p.page_id
WHERE r.rev_timestamp BETWEEN 20141201000000 AND 20150100000000 AND p.page_namespace=0 AND r.rev_id<>0
AND r.rev_user NOT IN (
SELECT ug.ug_user from user_groups ug
where ug.ug_group='bot'
)
GROUP BY r.rev_user_text HAVING (COUNT(r.rev_id)>5) | {"resultsets": [{"headers": ["rev_user", "count(r.rev_id)"], "rowcount": 649}]} | null |