title
stringlengths
1
212
description
stringlengths
1
4.39k
query
stringlengths
1
65.5k
extra_info
stringlengths
18
31.6k
wikidb
stringlengths
4
26
Daily article deletions
null
SELECT DATE( log_timestamp ) AS DATE, COUNT( log_id ) AS deletions FROM logging WHERE log_action='delete' AND log_namespace =0 GROUP BY DATE( log_timestamp )
{"resultsets": [{"headers": ["DATE", "deletions"], "rowcount": 3525}]}
enwiki_p
OMG look at all of these queries!
null
SELECT * FROM page WHERE page_namespace = 0 AND page_title LIKE "OMG!%";
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model"], "rowcount": 8}]}
enwiki_p
EpochFail's Normal query
null
SELECT * FROM page LIMIT 10;
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model"], "rowcount": 10}]}
enwiki_p
Daily newly registered users
null
/* specify a datetime range */ SET @start_date = '20131001000000'; SET @end_date = '20131101000000'; SELECT `log_user` AS user_id, REPLACE(`log_title`, '_', ' ') AS user_name, `log_timestamp` AS user_registration FROM logging WHERE `log_type` = 'newusers' AND `log_action` = 'create' /* only include self-created users, exclude attached and proxy-registered users */ AND `log_timestamp` BETWEEN @start_date AND @end_date;
{"resultsets": [{"headers": ["user_id", "user_name", "user_registration"], "rowcount": 157000}]}
enwiki_p
Bieber vs Einstein, incoming wikilinks
null
select count(*) from langlinks INNER JOIN page ON ll_from = page_id AND page_title = 'Justin_Bieber' AND page_namespace=0; select count(*) from langlinks INNER JOIN page ON ll_from = page_id AND page_title = 'Albert_Einstein' AND page_namespace=0;
{"resultsets": [{"headers": ["count(*)"], "rowcount": 1}, {"headers": ["count(*)"], "rowcount": 1}]}
enwiki_p
Big Bang vs The Big Bang Theory, langlinks
null
select count(*) from langlinks INNER JOIN page ON ll_from = page_id AND page_title = 'Big_Bang' AND page_namespace=0; select count(*) from langlinks INNER JOIN page ON ll_from = page_id AND page_title = 'The_Big_Bang_Theory' AND page_namespace=0;
{"resultsets": [{"headers": ["count(*)"], "rowcount": 1}, {"headers": ["count(*)"], "rowcount": 1}]}
enwiki_p
Breaking Bad vs Chemistry - interwiki links
null
select page_title, count(*) from langlinks INNER JOIN page ON ll_from = page_id AND page_title IN ('Breaking_Bad','Chemistry') AND page_namespace=0 GROUP BY page_title;
{"resultsets": [{"headers": ["page_title", "count(*)"], "rowcount": 2}]}
enwiki_p
Middle Ages, Game of Thrones
null
SELECT COUNT(*) FROM pagelinks WHERE pl_namespace = 0 AND pl_title = "Snoop_Dogg";
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
enwiki_p
list of new accounts since July 31, 2014
null
SELECT log_title, log_user, log_timestamp FROM enwiki_p.logging WHERE log_action = 'create' AND log_type='newusers' AND log_timestamp > 20140731000000 GROUP BY 1 ORDER BY log_timestamp;
{"resultsets": [{"headers": ["log_title", "log_user", "log_timestamp"], "rowcount": 218434}]}
enwiki_p
Nikerabbit's crash-your-browser-with-toomuchDATA<a href="javascript:alert('mui');">click me</a>
null
select * from page where page_title like '%bar';
{"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": 24}]}
null
<script>alert('XSS')</script>
null
/* <script>alert('xss')</script> */ select * from user limit 10
{"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": 10}]}
null
Thanks given on fi-wiki
null
use fiwiki_p; select substr(log_timestamp, 1, 8) as date, count(*) from logging where log_type="thanks" group by date;
{"resultsets": [{"headers": ["date", "count(*)"], "rowcount": 311}]}
null
Thanks/month on enwiki
null
SELECT LEFT(log_timestamp, 6) as month, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY month;
{"resultsets": [{"headers": ["month", "COUNT(*)"], "rowcount": 16}]}
null
EpochFail's use of "thanks" on enwiki and meta
null
SELECT "enwiki", COUNT(*) FROM enwiki_p.logging INNER JOIN enwiki_p.user ON log_user = user_id WHERE log_type = "thanks" AND user_name = "EpochFail"; SELECT "metawiki", COUNT(*) FROM metawiki_p.logging INNER JOIN metawiki_p.user ON log_user = user_id WHERE log_type = "thanks" AND user_name = "EpochFail";
{"resultsets": [{"headers": ["enwiki", "COUNT(*)"], "rowcount": 1}, {"headers": ["metawiki", "COUNT(*)"], "rowcount": 1}]}
null
Gadget statistics (not working, boo :( )
null
use plwiki_p; select up_property, count(*) from user_properties where up_property like "gadget-%" group by up_property;
{"resultsets": [{"headers": ["up_property", "count(*)"], "rowcount": 0}]}
null
Find pages that end with special characters
null
/*Select * from page where page_title RLIKE '(\\]|\\}|\\>|\\:|\\.|\\,|\\'|\\"|\\|\\?|\\–|\\—|\\?|\\…|\\!|\\?|\\-|\\?|\\;|\\/|\\\|\\&|\\*|\\^|\\%|\||\\$|\\#|\\@|\\™)$' LIMIT 10;*/ Select * from page where page_namespace = 0 AND page_title RLIKE '["\'\\]\\}\:]$' LIMIT 1000;
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model"], "rowcount": 1000}]}
null
Pages ending in :
null
/*Select * from page where page_title RLIKE '(\\]|\\}|\\>|\\:|\\.|\\,|\\'|\\"|\\|\\?|\\–|\\—|\\?|\\…|\\!|\\?|\\-|\\?|\\;|\\/|\\\|\\&|\\*|\\^|\\%|\||\\$|\\#|\\@|\\™)$' LIMIT 10;*/ Select * from page where page_namespace = 0 AND page_title RLIKE '[\\]\\}\:]$' LIMIT 1000;
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model"], "rowcount": 178}]}
null
Popular templates on English Wikipedia
Lists the 1000 most popular templates on English Wikipedia. Only counts templates from the Template: namespace. Does not filter on where the templates are transcluded into.
select tl_title, count(tl_title) as count from templatelinks where tl_namespace=10 group by tl_title order by count(tl_title) desc limit 1000;
{"resultsets": [{"headers": ["tl_title", "count"], "rowcount": 1000}]}
null
Usage of font-related gadgets on jawiki
apparently data is unavailable on the databases we can access
USE jawiki_p; SELECT up_property, COUNT(*) FROM user_properties WHERE up_property = "gadget-VectorClassicFonts" OR up_property = "gadget-SwitchFont" GROUP BY up_property;
{"resultsets": [{"headers": ["up_property", "COUNT(*)"], "rowcount": 0}]}
null
Top-500 most-interlinked pages
null
/* most-interlinked pages */ SELECT iwl_prefix, iwl_title, COUNT(iwl_from) AS num_links FROM iwlinks GROUP BY iwl_prefix,iwl_title ORDER BY num_links DESC LIMIT 500;
{"resultsets": [{"headers": ["iwl_prefix", "iwl_title", "num_links"], "rowcount": 500}]}
null
Userpreference Experiment - no data
null
SELECT COUNT(DISTINCT(up_user)) AS number_of_users, up_property AS preference FROM user_properties WHERE up_property IN ('usenewrc','extendwatchlist') AND up_value = 1 GROUP BY preference;
{"resultsets": [{"headers": ["number_of_users", "preference"], "rowcount": 0}]}
null
Skin usage by cohort
null
USE enwiki_p; SELECT count(user_id) AS number, up_value AS skin, (CASE WHEN user_editcount = 0 THEN 'edits0' WHEN user_editcount BETWEEN 1 AND 9 THEN 'edits1-9' WHEN user_editcount BETWEEN 10 AND 99 THEN 'edits10-999' WHEN user_editcount BETWEEN 100 AND 999 THEN 'edits100-9999' WHEN user_editcount BETWEEN 1000 AND 9999 THEN 'edits1000-99999' ELSE 'edits10000-' END) AS editorBucket, (CASE WHEN user_touched > DATE_SUB(NOW(), INTERVAL 1 MONTH) THEN 'live_0-1m' WHEN user_touched BETWEEN DATE_SUB(NOW(), INTERVAL 3 MONTH) AND DATE_SUB(NOW(), INTERVAL 1 MONTH) THEN 'live_1-3m' WHEN user_touched BETWEEN DATE_SUB(NOW(), INTERVAL 6 MONTH) AND DATE_SUB(NOW(), INTERVAL 3 MONTH) THEN 'live_3-6m' WHEN user_touched BETWEEN DATE_SUB(NOW(), INTERVAL 12 MONTH) AND DATE_SUB(NOW(), INTERVAL 6 MONTH) THEN 'live_6-12m' ELSE 'old' END) AS activeBucket FROM enwiki_p.user_properties INNER JOIN enwiki_p.user ON up_user=user_id WHERE up_property = 'skin' GROUP BY skin, editorBucket, activeBucket;
{"resultsets": [{"headers": ["number", "skin", "editorBucket", "activeBucket"], "rowcount": 83}]}
null
Daily number of "thanks" on jawiki
null
USE jawiki_p; SELECT substr(log_timestamp, 1, 8) AS date, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY date;
{"resultsets": [{"headers": ["date", "COUNT(*)"], "rowcount": 329}]}
null
Daily number of "thanks"
null
select substr(log_timestamp, 1, 8) as date, count(*) from logging where log_type="thanks" group by date;
{"resultsets": [{"headers": ["date", "count(*)"], "rowcount": 446}]}
null
English articles with infoboxes
Count the number of distinct articles (ns=0) with at least one infobox template. Known Bug: doesn't count Template:Taxobox articles.
USE enwiki_p; SELECT count(*) AS numarticles FROM page JOIN ( SELECT DISTINCT(tl_from) FROM templatelinks WHERE tl_namespace=10 AND tl_title LIKE 'Infobox%') AS t ON page_id=t.tl_from WHERE page_namespace=0;
{"resultsets": [{"headers": ["numarticles"], "rowcount": 1}]}
null
Med translation interlanguage links
Query giving all the interlanguage links for WikiProject Medicine Translation task force
SELECT p2.page_title as "English article", ll_lang as "Lang code", ll_title "Translated name" FROM categorylinks inner join page p1 on cl_from = p1.page_id and p1.page_namespace = 1 inner join page p2 on p2.page_title = p1.page_title and p2.page_namespace = 0 and p1.page_namespace = 1 left outer join langlinks on p2.page_id = ll_from where cl_to = 'WikiProject_Medicine_Translation_Task_Force_articles';
{"resultsets": [{"headers": ["English article", "Lang code", "Translated name"], "rowcount": 5157}]}
null
Links on a page
This will pull the names of the links on a particular page. For example, the text of the "Don't poke the bear" page contains the link "[[bear]]" so the output of this query will list "Bear" as a result.
SELECT pl_namespace, pl_title FROM page JOIN pagelinks ON pl_from = page_id WHERE page_namespace = 0 AND page_title = 'Don\'t_poke_the_bear';
{"resultsets": [{"headers": ["pl_namespace", "pl_title"], "rowcount": 0}]}
null
25 most edited enwiki pages in the last month
The 25 most edited articles on English Wikipedia in the last month.
SELECT rc_title, COUNT(*) AS num_edits FROM recentchanges WHERE rc_namespace = 0 GROUP BY rc_title ORDER BY num_edits DESC LIMIT 25;
{"resultsets": [{"headers": ["rc_title", "num_edits"], "rowcount": 25}]}
null
WikiLove sent during Wikimania 2014
Logged data about all WikiLove messages sent during the 2014 Wikimania conference.
SELECT * FROM enwiki_p.wikilove_log WHERE wll_timestamp BETWEEN 20140806000000 AND 20140811000000;
{"resultsets": [{"headers": ["wll_id", "wll_timestamp", "wll_sender", "wll_sender_registration", "wll_sender_editcount", "wll_receiver", "wll_receiver_registration", "wll_receiver_editcount", "wll_type", "wll_subject", "wll_message", "wll_email"], "rowcount": 206}]}
null
My first Query
A test query
select * from revision where rev_user_text = "Jtmorgan" limit 1;
{"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"], "rowcount": 1}]}
null
List of tables
Ignore
show tables;
{"resultsets": [{"headers": ["Tables_in_enwiki_p"], "rowcount": 108}]}
null
Current edit count of some 2002 editors
This query gets you the current edit count of any editor who edited English Wikipedia on January 25th 2002 by joining the user and revision table on their common keys: user_id = rev_user.
SELECT user_name, user_registration, user_editcount, rev_timestamp FROM user JOIN revision ON user_id = rev_user WHERE rev_timestamp LIKE "20020125%" GROUP BY user_name;
{"resultsets": [{"headers": ["user_name", "user_registration", "user_editcount", "rev_timestamp"], "rowcount": 51}]}
null
webinar experiments
null
SELECT page_title FROM page JOIN templatelinks ON tl_from = page_id JOIN categorylinks ON cl_from = page_id WHERE cl_to = "Oral_hygiene" AND tl_namespace = 10 AND tl_title = "Clarification_needed" AND page_namespace = 0;
{"resultsets": [{"headers": ["page_title"], "rowcount": 0}]}
null
Limit results
null
SELECT DISTINCT rc_user_text FROM recentchanges WHERE rc_user = 0 AND rc_namespace = 4 AND rc_title = "Teahouse/Questions" AND rc_comment like "%*/ new section" LIMIT 5;
{"resultsets": [{"headers": ["rc_user_text"], "rowcount": 5}]}
null
Zhwiki table descriptions (revision, page, user)
Descriptions of the fields within three major tables on Chinese Wikipedia: revision (edits), page (wiki pages), and user (registered and unregistered editors).
DESCRIBE zhwiki_p.revision; DESCRIBE zhwiki_p.page; DESCRIBE zhwiki_p.user;
{"resultsets": [{"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 12}, {"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 13}, {"headers": ["Field", "Type", "Null", "Key", "Default", "Extra"], "rowcount": 16}]}
null
5 recent anon Teahouse questioners
5 anonymous editors who have recently asked questions at the Teahouse. Uses the recentchanges table, which contains revision data from the past 90 days--so queries should run faster against this table than the full revision table, which contains ALL revisions.
SELECT DISTINCT rc_user_text FROM recentchanges WHERE rc_user = 0 AND rc_namespace = 4 AND rc_title = "Teahouse/Questions" AND rc_comment like "%*/ new section" limit 5;
{"resultsets": [{"headers": ["rc_user_text"], "rowcount": 5}]}
null
WikiLove sent during Wikimania 2014 in Chinese Wikipedia
null
SELECT * FROM zhwiki_p.wikilove_log WHERE wll_timestamp BETWEEN 20140806000000 AND 20140811000000;
{"resultsets": [{"headers": ["wll_id", "wll_timestamp", "wll_sender", "wll_sender_registration", "wll_sender_editcount", "wll_receiver", "wll_receiver_registration", "wll_receiver_editcount", "wll_type", "wll_subject", "wll_message", "wll_email"], "rowcount": 27}]}
null
Info on editors to a page and its talk page
the usernames of all the people who had edited the page (or talk page) of the article, along with how many times they edited, the total number of bytes they have added (or removed), and the date of their most recent edit.
SELECT rev_user_text AS editor, COUNT(rev_id) AS num_edits, SUM(rev_len) AS bytes_changed, MAX(rev_timestamp) AS most_recent_edit FROM revision INNER JOIN page ON revision.rev_page = page.page_id WHERE page.page_namespace IN (0,1) AND page_title = "Howard_Gobioff" GROUP BY editor ORDER BY num_edits DESC;
{"resultsets": [{"headers": ["editor", "num_edits", "bytes_changed", "most_recent_edit"], "rowcount": 19}]}
null
Total edits to a set of related pages by a cohort
Total edits by a list of Teahouse hosts to WP:Teahouse and it's subpages and talk pages.
SELECT rev_user_text, COUNT(rev_id) AS total_edits FROM revision JOIN page on rev_page = page_id WHERE page_namespace IN (4,5) AND page_title LIKE "Teahouse%" AND rev_user_text IN ('Rosiestep','Writ Keeper','Doctree','Osarius','Nathan2055','Benzband', 'Ushau97','Technical 13', 'I JethroBT', 'Dathus') GROUP BY rev_user_text ORDER BY total_edits DESC;
{"resultsets": [{"headers": ["rev_user_text", "total_edits"], "rowcount": 10}]}
null
Highly active new editors
“get me every new account that has been created within the past day, has made at least 10 edits, is not a bot, and has not been blocked yet”
SELECT user_id, user_name, user_registration, user_editcount FROM enwiki_p.user WHERE user_registration > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y%m%d%H%i%s') AND user_editcount > 10 AND user_id NOT IN (SELECT ug_user FROM enwiki_p.user_groups WHERE ug_group = 'bot') AND user_name not in (SELECT REPLACE(log_title,"_"," ") from enwiki_p.logging where log_type = "block" and log_action = "block" and log_timestamp > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 2 DAY),'%Y%m%d%H%i%s'));
{"resultsets": [{"headers": ["user_id", "user_name", "user_registration", "user_editcount"], "rowcount": 50}]}
null
100 least updated articles on Swedish Wikipedia
Lists the 100 articles that has not been touched for the longest time.
SELECT page_title, page_touched, page_len FROM svwiki_p.page WHERE page_namespace = 0 AND page_is_redirect = 0 ORDER BY page_touched ASC LIMIT 100;
{"resultsets": [{"headers": ["page_title", "page_touched", "page_len"], "rowcount": 100}]}
null
100 shortest articles on Swedish Wikipedia
null
SELECT DISTINCT page_title, page_len, page_touched FROM svwiki_p.page LEFT JOIN svwiki_p.templatelinks ON tl_from = page_id LEFT JOIN svwiki_p.page_props ON pp_page = page_id WHERE page_namespace = 0 AND page_is_redirect = 0 AND tl_namespace = 10 AND tl_title != 'Wiktionary-omdirigering' AND tl_title != 'Förgrening' AND tl_title != 'Förgrening_bas' AND tl_title != 'Gren' AND tl_title != 'Namnförgrening' AND tl_title != 'Grensida' AND tl_title != 'Förgreningssida' AND tl_title != 'Disambig' AND tl_title != 'Hndis' AND tl_title != 'Gaffel' AND tl_title != 'Namngrensida' AND pp_propname != 'disambiguation' AND pp_propname != 'wikibase_item' ORDER BY page_len ASC LIMIT 100;
{"resultsets": [{"headers": ["page_title", "page_len", "page_touched"], "rowcount": 100}]}
null
100 danske Wikipedia-artikler, som har stået "urørt" længst
100 danske Wikipedia-artikler, som har stået "urørt" længst.
SELECT page_title, page_touched, page_len FROM dawiki_p.page WHERE page_namespace = 0 AND page_is_redirect = 0 ORDER BY page_touched ASC LIMIT 100;
{"resultsets": [{"headers": ["page_title", "page_touched", "page_len"], "rowcount": 100}]}
null
25 most edited dawiki pages in the last month
The 25 most edited articles on Danish Wikipedia in the last month.
SELECT rc_title, COUNT(*) AS num_edits FROM dawiki_p.recentchanges WHERE rc_namespace = 0 GROUP BY rc_title ORDER BY num_edits DESC LIMIT 25;
{"resultsets": [{"headers": ["rc_title", "num_edits"], "rowcount": 25}]}
null
Active new editors on Danish Wikipedia
“get me every new account on Danish Wikipedia that has been created within the past week, has made at least 10 edits, is not a bot, and has not been blocked yet”
SELECT user_id, user_name, user_registration, user_editcount FROM dawiki_p.user WHERE user_registration > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 7 DAY),'%Y%m%d%H%i%s') AND user_editcount > 10 AND user_id NOT IN (SELECT ug_user FROM dawiki_p.user_groups WHERE ug_group = 'bot') AND user_name NOT IN (SELECT REPLACE(log_title,"_"," ") FROM dawiki_p.logging WHERE log_type = "block" AND log_action = "block" AND log_timestamp > DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 8 DAY),'%Y%m%d%H%i%s'));
{"resultsets": [{"headers": ["user_id", "user_name", "user_registration", "user_editcount"], "rowcount": 5}]}
null
Find flagged revs unreviewd articles
This query will list articles which can be easily reviewed with flagged revs.
use fiwiki_p; select page_title, page_id from (select page_id, fp_page_id,r1.rev_id,page.page_title,r1.rev_user, sum(abs(cast(r1.rev_len as int) - cast(r2.rev_len as int))) as diff_len, page_len, page.page_is_redirect, ugs.ug_user, min(r1.rev_parent_id) as parent_id from page left join flaggedpages on fp_page_id=page.page_id, revision as r1 LEFT JOIN (SELECT ug_user FROM user_groups WHERE ug_group IN ('editor', 'autoreview', 'admin','bot')) as ugs ON r1.rev_user=ug_user, revision as r2 where fp_page_id IS NULL AND r1.rev_page=page.page_id AND r1.rev_parent_id=r2.rev_id and ugs.ug_user IS NULL AND page_namespace = 0 and page_is_redirect = 0 AND page_len > 100 group by page_id ) as n WHERE diff_len < 600;
{"resultsets": [{"headers": ["page_title", "page_id"], "rowcount": 51902}]}
null
Thanks per day in Enwiki
null
SELECT LEFT(log_timestamp, 8) as day, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY day;
{"resultsets": [{"headers": ["day", "COUNT(*)"], "rowcount": 452}]}
null
Media Viewer preference counts
Shows the counts for various values of the enwiki Media Viewer preference.
use commonswiki_p; select up_value, count(*) from user_properties where up_property = "multimediaviewer-enable" group by up_value;
{"resultsets": [{"headers": ["up_value", "count(*)"], "rowcount": 0}]}
null
Top 25 most edited czech articles
null
SELECT rc_title, COUNT(*) AS num_edits FROM cswiki_p.recentchanges WHERE rc_namespace = 0 GROUP BY rc_title ORDER BY num_edits DESC LIMIT 25;
{"resultsets": [{"headers": ["rc_title", "num_edits"], "rowcount": 25}]}
null
Concat test
null
SELECT concat('[//nl.wikipedia.org/w/index.php?title=',page_title,']') FROM page LIMIT 10;
{"resultsets": [{"headers": ["concat('[//nl.wikipedia.org/w/index.php?title=',page_title,']')"], "rowcount": 10}]}
null
Recent anon edits to secret society articles
enwiki articles in the enwiki Category:Secret_societies that have been edited at least once within the past month by anonymous users, and the number of anon edits per article within that time period.
SELECT COUNT(rc_id) AS revs, tmp.page_title FROM recentchanges r INNER JOIN (SELECT page_title FROM enwiki_p.page AS m INNER JOIN enwiki_p.categorylinks AS cl ON m.page_id = cl.cl_from WHERE cl.cl_to IN ('Secret_societies') AND cl.cl_type = 'page') tmp ON r.rc_title = tmp.page_title WHERE r.rc_namespace = 0 AND r.rc_user = 0 AND r.rc_source = "mw.edit" GROUP BY tmp.page_title ORDER BY revs DESC;
{"resultsets": [{"headers": ["revs", "page_title"], "rowcount": 16}]}
null
Harry Potter movie article edits
Pages in Category:Harry_Potter_(film_series), along with the total revs to each page.
SELECT COUNT(rev_id) AS revs, tmp.page_title FROM revision r INNER JOIN (SELECT page_id, page_title FROM enwiki_p.page AS p INNER JOIN enwiki_p.categorylinks AS cl ON p.page_id = cl.cl_from WHERE cl.cl_to IN ('Harry_Potter_(film_series)') AND cl.cl_type = 'page' AND p.page_namespace = 0) tmp ON r.rev_page = tmp.page_id GROUP BY tmp.page_title ORDER BY revs DESC;
{"resultsets": [{"headers": ["revs", "page_title"], "rowcount": 11}]}
null
Wikilove on Swedish Wikipedia 2014
null
SELECT * FROM svwiki_p.wikilove_log WHERE wll_timestamp > 20140101000000;
{"resultsets": [{"headers": ["wll_id", "wll_timestamp", "wll_sender", "wll_sender_registration", "wll_sender_editcount", "wll_receiver", "wll_receiver_registration", "wll_receiver_editcount", "wll_type", "wll_subject", "wll_message", "wll_email"], "rowcount": 95}]}
null
Stroopwafel Wikilovers, 2013-14
People who have sent Stroopwafels via Wikilove between August 27, 2013 and August 27 2014. And the number of wafels sent per user.
SELECT user_name, COUNT(wll_id) waffles_sent FROM user u INNER JOIN wikilove_log wl ON u.user_id = wl.wll_sender WHERE wl.wll_type = "food-stroopwafels" AND wl.wll_timestamp > 20130827000000 GROUP BY user_name ORDER BY waffles_sent DESC;
{"resultsets": [{"headers": ["user_name", "waffles_sent"], "rowcount": 97}]}
null
Some Teahouse question rev ids
Get the revision ids of the first 100 questions asked at the enwiki Teahouse in 2014
select rev_id from revision where rev_page = 34745517 and rev_user != 0 and rev_timestamp > 20140101000000 and rev_comment like "%*/ new section" order by rev_timestamp ASC LIMIT 100;
{"resultsets": [{"headers": ["rev_id"], "rowcount": 100}]}
null
Pages in MediaWiki namespace with a "/" (nlwiki)
null
SELECT page_title FROM nlwiki_p.page WHERE page_namespace = 8 AND page_title LIKE '%/%' LIMIT 50;
{"resultsets": [{"headers": ["page_title"], "rowcount": 14}]}
null
Pages in MediaWiki namespace with a "/" (enwiki)
null
SELECT page_title FROM enwiki_p.page WHERE page_namespace = 8 AND page_title LIKE '%/%' LIMIT 50;
{"resultsets": [{"headers": ["page_title"], "rowcount": 50}]}
null
Wikimania 2014 breakdown per photographer
null
use commonswiki_p; SELECT /* SLOW_OK */ DISTINCT img_user_text AS USER, COUNT(image.img_name) AS img_count FROM image, page, categorylinks WHERE page.page_id=categorylinks.cl_from AND image.img_name = page.page_title AND categorylinks.cl_to = "Wikimania_2014" GROUP BY USER ORDER BY img_count DESC;
{"resultsets": [{"headers": ["USER", "img_count"], "rowcount": 16}]}
null
egalvezquery
Data for the learning & evaluation team
#non-bot edits to the Grants:Evaluation namespace by month/year 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 Portal_total_revisions FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace = 200 AND p.page_title LIKE "Evaluation%" AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #non-bot, non-WMF edits to the Grants:Evaluation namespace by month/year 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 Portal_nonwmf_revisions FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace = 200 AND p.page_title LIKE "Evaluation%" AND rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Wolliff") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #non-bot edits to the Grants TALK: Evaluation namespace by month/year 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 PotalTalk_revisions FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace = 201 AND p.page_title LIKE "Evaluation%" AND rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #non-bot, non-WMF edits to the Grants TALK: Evaluation namespace by month/year 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 PortalTalk_nonwmf_revisions FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace = 201 AND p.page_title LIKE "Evaluation%" AND rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Wolliff") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #non-bot, non-WMF editors to the Grants:Evaluation namespace by month/year 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 non_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) AND p.page_title LIKE "Evaluation%" AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Wolliff") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #non-bot, non-WMF edits to Learning Patterns by month/year 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 LP_nonwmf_revisions FROM metawiki_p.revision r INNER JOIN metawiki_p.page AS p ON r.rev_page = p.page_id WHERE p.page_namespace IN (200, 201) AND p.page_title LIKE "Learning_patterns%" AND rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Wolliff") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC; #non-bot, non-WMF editors to Learning Patterns by month/year 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 LP_nonwmf_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) 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') AND r.rev_user_text NOT LIKE "%(WMF)" AND r.rev_user_text NOT IN ("Ijon", "Wolliff") AND r.rev_timestamp > 20131001000000 GROUP BY `year`, `month` ORDER BY `year` ASC, `month` ASC;
{"resultsets": [{"headers": ["year", "month", "Portal_total_revisions"], "rowcount": 12}, {"headers": ["year", "month", "Portal_nonwmf_revisions"], "rowcount": 12}, {"headers": ["year", "month", "PotalTalk_revisions"], "rowcount": 11}, {"headers": ["year", "month", "PortalTalk_nonwmf_revisions"], "rowcount": 11}, {"headers": ["year", "month", "non_wmf_editors"], "rowcount": 12}, {"headers": ["year", "month", "LP_nonwmf_revisions"], "rowcount": 12}, {"headers": ["year", "month", "LP_nonwmf_editors"], "rowcount": 12}]}
null
Recent External Links
I think these are the last 10 links added to English Wikipedia articles. It runs kind of slow, can you speed it up, or make it better?
SELECT page.page_title, el_to, page.page_links_updated FROM externallinks, page WHERE externallinks.el_id = page.page_id ORDER BY el_id DESC LIMIT 10
{"resultsets": [{"headers": ["page_title", "el_to", "page_links_updated"], "rowcount": 10}]}
null
Evaluation portal - edits and editors per month
no bots, no IPs, no WMF staff last run on September 3rd, 2014
#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_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 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;
{"resultsets": [{"headers": ["year", "month", "edits"], "rowcount": 12}, {"headers": ["year", "month", "editors"], "rowcount": 12}]}
null
Grants namespaces - edits and editors per month
no bots, no IPs, no WMF staff last run on September 3rd, 2014
#edits 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(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 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 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 editors AND r.rev_user NOT IN (SELECT ug_user FROM metawiki_p.user_groups WHERE ug_group = 'bot') #not a registered bot AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account AND r.rev_user_text NOT IN ("Ijon", "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": 12}, {"headers": ["year", "month", "editors"], "rowcount": 12}]}
null
IdeaLab - edits and editors per month
no bots, no IPs, no WMF staff last run on September 3rd, 2014
#edits to the idealab 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 "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 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 "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", "edits"], "rowcount": 12}, {"headers": ["year", "month", "editors"], "rowcount": 12}]}
null
Uncategorized cats on commons
null
use commonswiki_p; select page_title from page left outer join categorylinks on cl_from = page_id where cl_from is null and page_namespace = 14;
{"resultsets": [{"headers": ["page_title"], "rowcount": 121}]}
null
Show WMF, WMDE, WMSE ... etc users
null
use fiwiki_p; select user_name, user_editcount from user where user_name like "%\(%WM%" AND user_editcount >0;
{"resultsets": [{"headers": ["user_name", "user_editcount"], "rowcount": 11}]}
null
Links to Commons from Wikidata (limited)
cf http://quarry.wmflabs.org/query/441
use wikidatawiki_p; SELECT * FROM wb_items_per_site WHERE ips_site_id='commonswiki' ORDER BY ips_item_id LIMIT 10;
{"resultsets": [{"headers": ["ips_row_id", "ips_item_id", "ips_site_id", "ips_site_page"], "rowcount": 10}]}
null
Links to Commons from Wikidata
NOTE: Query fails silently -- it should return about 330,000 rows, but this appears to be more than the friendly Quarry front-end can cope with.
use wikidatawiki_p; SELECT * FROM wb_items_per_site WHERE ips_site_id='commonswiki';
{"resultsets": [{"headers": ["ips_row_id", "ips_item_id", "ips_site_id", "ips_site_page"], "rowcount": 430609}]}
null
Links to Commons from Wikidata (count)
cf http://quarry.wmflabs.org/query/441
use wikidatawiki_p; SELECT COUNT(*) FROM wb_items_per_site WHERE ips_site_id='commonswiki';
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
Wikimedia Commons files with no {{Information}} (or similar) template
Files on Wikimedia Commons not using an {{Information}} style template Actually taken from <https://tools.wmflabs.org/add-information/no_information.php>/<https://bitbucket.org/magnusmanske/add_information/src/575756d260678494859fffec72583ee333922393/public_html/no_information.php?at=master> List : ('Information', 'Artwork', 'Book', 'Art_Photo', 'Photograph', 'Book', 'Map', 'Musical_work', 'Specimen')
use commonswiki_p; SELECT page_title FROM page, image WHERE page.page_namespace = 6 AND page.page_title = image.img_name AND page_id NOT IN ( SELECT tl_from FROM templatelinks WHERE tl_title IN ('Information', 'Artwork', 'Book', 'Art_Photo', 'Photograph', 'Book', 'Map', 'Musical_work', 'Specimen') ) ORDER BY page_title LIMIT 100;
{"resultsets": [{"headers": ["page_title"], "rowcount": 100}]}
null
Oldest Articles in astwiki
Gathers the oldest articles in astwiki assuming that page_id is auto incremented.
USE astwiki_p; SELECT page_id, page_title, (SELECT MIN(rev_timestamp) FROM revision WHERE rev_page = page_id) AS first_revision FROM page WHERE page_namespace = 0 ORDER BY page_id LIMIT 10;
{"resultsets": [{"headers": ["page_id", "page_title", "first_revision"], "rowcount": 10}]}
null
Verbos sem conjugação
null
USE ptwiktionary_p; SELECT page_title FROM categorylinks INNER JOIN page ON cl_from = page_id WHERE cl_to = 'Verbo_(Português)' AND cl_type = 'page' AND cl_from NOT IN (SELECT tl_from FROM templatelinks WHERE tl_namespace = 10 AND tl_title LIKE 'conj.pt.%');
{"resultsets": [{"headers": ["page_title"], "rowcount": 1615}]}
null
Users who thank the most on enwiki
Users who thank the most on enwiki
USE enwiki_p; SELECT log_user_text, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY log_user_text ORDER BY COUNT(*) DESC LIMIT 100;
{"resultsets": [{"headers": ["log_user_text", "COUNT(*)"], "rowcount": 100}]}
null
Most thanked users on enwiki
null
USE enwiki_p; SELECT log_title, COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY log_title ORDER BY COUNT(*) DESC LIMIT 1000;
{"resultsets": [{"headers": ["log_title", "COUNT(*)"], "rowcount": 1000}]}
null
Most common thanker/thanked unordered pairs
null
USE enwiki_p; SELECT LEAST(REPLACE(log_title,'_',' '),log_user_text), GREATEST(REPLACE(log_title,'_',' '), log_user_text), COUNT(*) FROM logging WHERE log_type="thanks" GROUP BY 1, 2 ORDER BY 3 DESC LIMIT 100;
{"resultsets": [{"headers": ["LEAST(REPLACE(log_title,'_',' '),log_user_text)", "GREATEST(REPLACE(log_title,'_',' '), log_user_text)", "COUNT(*)"], "rowcount": 100}]}
null
Uncategorized pages on metawiki sorted by number of backlinks
null
USE metawiki_p; SELECT page_namespace, page_title, COUNT(pl_from) FROM page LEFT JOIN categorylinks ON cl_from=page_id LEFT JOIN pagelinks ON pl_namespace=page_namespace AND pl_title=page_title WHERE cl_from IS NULL AND page_namespace=0 AND page_is_redirect=0 GROUP BY page_title ORDER BY 3 DESC;
{"resultsets": [{"headers": ["page_namespace", "page_title", "COUNT(pl_from)"], "rowcount": 5862}]}
null
Uncategorized articles on enwiki sorted by number of backlinks
IMPORTANT NOTE: Almost all of the popular included pages (e.g. Estonia) were only uncategorized briefly due to vandalism.
USE enwiki_p; SELECT page_namespace, page_title, COUNT(pl_from) FROM page LEFT JOIN categorylinks ON cl_from=page_id LEFT JOIN pagelinks ON pl_namespace=page_namespace AND pl_title=page_title WHERE cl_from IS NULL AND page_namespace=0 AND page_is_redirect=0 GROUP BY page_title ORDER BY 3 DESC;
{"resultsets": [{"headers": ["page_namespace", "page_title", "COUNT(pl_from)"], "rowcount": 115}]}
null
WikiProject template redirects on enwiki
null
use enwiki_p; select page_title as source, rd_title as target, count(tl_from) as links from redirect join page on page_id=rd_from left join templatelinks on tl_namespace=10 and tl_title=page_title where rd_namespace=10 and page_namespace=10 and lower(rd_title) like "wikiproject%" collate utf8_general_ci group by page_title;
{"resultsets": [{"headers": ["source", "target", "links"], "rowcount": 4100}]}
null
Good article nominees on enwiki sorted by page size
null
USE enwiki_p; SELECT talk.page_title, gan.page_len FROM categorylinks LEFT JOIN page talk ON cl_from=talk.page_id JOIN page gan ON gan.page_title=talk.page_title AND gan.page_namespace=0 WHERE cl_to="Good_article_nominees" ORDER BY gan.page_len DESC;
{"resultsets": [{"headers": ["page_title", "page_len"], "rowcount": 538}]}
null
All columns from all Xhosa Wikipedia (xhwiki) pages
test
SELECT * FROM xhwiki_p.page;
{"resultsets": [{"headers": ["page_id", "page_namespace", "page_title", "page_restrictions", "page_counter", "page_is_redirect", "page_is_new", "page_random", "page_touched", "page_links_updated", "page_latest", "page_len", "page_content_model"], "rowcount": 1997}]}
null
Show databases
null
SHOW DATABASES;
{"resultsets": [{"headers": ["Database"], "rowcount": 1821}]}
null
Users with most edits on Zulu Wikipedia (zuwiki), excluding bots
null
USE zuwiki_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 /* Exclude global bots. Don't worry about unattached. */ (SELECT gu_name FROM centralauth_p.globaluser 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
Wikidata items with direct sitelinks to File pages on Commons
Explanation: Files are not articles or categories, so Wikidata entries should not usually have sitelinks registered to them. For a formatted list, use http://quarry.wmflabs.org/query/451 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/File
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'File:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 153}]}
null
Wikidata items with sitelinks to Commons pages on Commons
A list of Wikidata items with sitelinks to Commons: pages on Commons. For a formatted list, use http://quarry.wmflabs.org/query/482 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Commons
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Commons:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 231}]}
null
Wikidata items with sitelinks to Help pages on Commons
A list of Wikidata items with sitelinks to pages in the Help namespace on Commons. For a formatted list, use http://quarry.wmflabs.org/query/484 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Help
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Help:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 19}]}
null
Wikidata items with sitelinks to Creator pages on Commons
A list of Wikidata items with sitelinks to pages in the Creator namespace on Commons. For a formatted list, use http://quarry.wmflabs.org/query/486 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Creator
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Creator:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 58}]}
null
Wikidata items with sitelinks to Institution pages on Commons
A list of Wikidata items with sitelinks to pages in the Institution namespace on Commons. For a formatted list, use http://quarry.wmflabs.org/query/488 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Institution
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Institution:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 8}]}
null
Wikidata items with sitelinks to Template pages on Commons
A list of Wikidata items with sitelinks to pages in the Template namespace on Commons. For a formatted list, use http://quarry.wmflabs.org/query/490 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Template
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Template:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 1563}]}
null
Wikidata items with sitelinks to Module pages on Commons
A list of Wikidata items with sitelinks to pages in the Module namespace on Commons. For a formatted list, use http://quarry.wmflabs.org/query/492 Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Module
use wikidatawiki_p; SELECT CONCAT('Q', ips_item_id) AS item, ips_site_page AS link FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Module:%' ORDER BY ips_item_id ASC;
{"resultsets": [{"headers": ["item", "link"], "rowcount": 17}]}
null
Wikidata items with sitelinks to Module pages on Commons (formatted)
A formatted list of Wikidata items with sitelinks to pages in the Module: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Module For an unformatted list, use http://quarry.wmflabs.org/query/491
use wikidatawiki_p; SELECT CONCAT('* [[Q', ips_item_id, ']] : [[:c:', ips_site_page, ']] <--- {{Q|', ips_item_id, '}}') AS '== List of sitelinks ==' FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Module:%' ORDER BY ips_item_id;
{"resultsets": [{"headers": ["== List of sitelinks =="], "rowcount": 17}]}
null
List of hiwiki users by number of edits (excl. bots)
null
USE hiwiki_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="hiwiki" JOIN centralauth_p.global_user_groups ON gug_user=gu_id WHERE gug_group="global-bot") ORDER BY user_editcount DESC LIMIT 1000;
{"resultsets": [{"headers": ["user_name", "user_editcount"], "rowcount": 1000}]}
null
Revisions featured articles @ ptwiki
date format YYYYMMDDhhmmss
use ptwiki_p; select rev_user_text, rev_timestamp, page_title from revision left join page on rev_page = page_id where page_id IN (select distinct cl_from from categorylinks where cl_to = "!Artigos_destacados") AND rev_timestamp < 20140900000000;
{"resultsets": [{"headers": ["rev_user_text", "rev_timestamp", "page_title"], "rowcount": 354339}]}
null
Wikidata items with sitelinks to Template pages on Commons (formatted)
A formatted list of Wikidata items with sitelinks to pages in the Template: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Template For an unformatted list, use http://quarry.wmflabs.org/query/489
use wikidatawiki_p; SELECT CONCAT('* [[Q', ips_item_id, ']] : [[:c:', ips_site_page, ']] <--- {{Q|', ips_item_id, '}}') AS '== List of sitelinks ==' FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Template:%' ORDER BY ips_item_id;
{"resultsets": [{"headers": ["== List of sitelinks =="], "rowcount": 1553}]}
null
Wikidata items with sitelinks to Template pages on Commons (count)
Count of Wikidata items with sitelinks to pages in the Template: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Template
use wikidatawiki_p; SELECT COUNT(*) FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Template:%';
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
Wikidata items with sitelinks to Module pages on Commons (count)
Count of Wikidata items with sitelinks to pages in the Module: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Module
use wikidatawiki_p; SELECT COUNT(*) FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Module:%';
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
Wikidata items with sitelinks to Commons pages on Commons (count)
Count of Wikidata items with sitelinks to pages in the Commons: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Commons
use wikidatawiki_p; SELECT COUNT(*) FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Commons:%';
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
Wikidata items with sitelinks to Commons pages on Commons (formatted)
A formatted list of Wikidata items with sitelinks to pages in the Commons: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Commons For an unformatted list, use http://quarry.wmflabs.org/query/481
use wikidatawiki_p; SELECT CONCAT('* [[Q', ips_item_id, ']] : [[:c:', ips_site_page, ']] <--- {{Q|', ips_item_id, '}}') AS '== List of sitelinks ==' FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Commons:%' ORDER BY ips_item_id;
{"resultsets": [{"headers": ["== List of sitelinks =="], "rowcount": 247}]}
null
Wikidata items with sitelinks to Help pages on Commons (formatted)
A formatted list of Wikidata items with sitelinks to pages in the Help: namespace on Commons. Published at https://www.wikidata.org/wiki/Wikidata:WikiProject_Structured_Data_for_Commons/Phase_1_progress/Links/Help For an unformatted list, use http://quarry.wmflabs.org/query/483
use wikidatawiki_p; SELECT CONCAT('* [[Q', ips_item_id, ']] : [[:c:', ips_site_page, ']] <--- {{Q|', ips_item_id, '}}') AS '== List of sitelinks ==' FROM wb_items_per_site WHERE ips_site_id='commonswiki' AND ips_site_page LIKE 'Help:%' ORDER BY ips_item_id;
{"resultsets": [{"headers": ["== List of sitelinks =="], "rowcount": 20}]}
null
Most linked stubs on hu.wikipedia
Lists the 1000 most linked stubs. Relies on huwiki template names.
USE huwiki_p; SELECT CONCAT('*[[',pl_title,']] (', COUNT(*),' link)') FROM pagelinks pl INNER JOIN page p ON pl.pl_title = p.page_title WHERE pl.pl_namespace = 0 AND EXISTS (SELECT * FROM templatelinks WHERE SUBSTR(tl_title FROM 1 FOR 5) = 'Csonk' AND tl_from = p.page_id LIMIT 1 ) GROUP BY pl.pl_title ORDER BY COUNT(*) DESC LIMIT 1000;
{"resultsets": [{"headers": ["CONCAT('*[[',pl_title,']] (', COUNT(*),' link)')"], "rowcount": 1000}]}
null
EpochFail's edits in metawiki since 20140101
null
USE metawiki_p; SELECT COUNT(*) FROM revision_userindex WHERE rev_user_text = "EpochFail" AND rev_timestamp >= "20140101";
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null
EpochFail's edits in Enwiki since 20140101
null
SELECT COUNT(*) FROM revision_userindex WHERE rev_user_text = "EpochFail" AND rev_timestamp >= "20140101";
{"resultsets": [{"headers": ["COUNT(*)"], "rowcount": 1}]}
null

Dataset Card for "wikidb"

More Information needed

Downloads last month
0
Edit dataset card