SQL
AخA
WITH ns(ns_n, ns_s) AS (VALUES (-2, 'Media:'), (-1, 'Special:'), (0, ''), (1, 'Talk:'), (2, 'User:'), (3, 'User talk:'), (4,
'Wikipedia:'), (5, 'Wikipedia talk:'), (6, ':File:'), (7, 'File talk:'), (8, 'MediaWiki:'), (9, 'MediaWiki talk:'), (10, 'Template:'),
(11, 'Template talk:'), (12, 'Help:'), (13, 'Help talk:'), (14, ':Category:'), (15, 'Category talk:'), (100, 'Portal:'), (101,
'Portal talk:'), (118, 'Draft:'), (119, 'Draft talk:'), (126, 'MOS:'), (127, 'MOS talk:'), (710, 'TimedText:'), (711, 'TimedText talk:'),
(828, 'Module:'), (829, 'Module talk:'))
SELECT CONCAT(COALESCE(ns1.ns_s, CONCAT('{{ns:', page_namespace, '}}:')), page_title) AS pagename,
CONCAT(ns1.ns_s, page_title) AS 'pagename, simpler',
CONCAT(COALESCE(ns_plus_4.ns_s, CONCAT('{{ns:', page_namespace + 4, '}}:')), page_title) AS 'pagename in ns+4',
CONCAT(ns_plus_4.ns_s, page_title) AS 'pagename in ns+4, simpler'
FROM page
LEFT JOIN ns AS ns1 ON ns1.ns_n = page_namespace
LEFT JOIN ns AS ns_plus_4 ON ns_plus_4.ns_n = page_namespace + 4
WHERE page_random BETWEEN 0.3916 AND 0.391601;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.