Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
First words of non-redirect article titles with more than 50 occurrances
by
Ahecht
This query is marked as a draft
This query has been published
by
Certes
.
This query attempts to list given names lacking an article. It's not foolproof but should be useful. The Chinese bit filters out people such as Xu Chen, whose first name has no given-name article because it is a surname. (Sadly, it also filters out names such as Lee which are both a given name and a Chinese surname.)
Toggle Highlighting
SQL
SELECT COUNT(Cb.cl_to) AS people, SUBSTRING_INDEX(page_title, "_", 1) AS first_word FROM page LEFT JOIN categorylinks Cb ON Cb.cl_from = page_id AND Cb.cl_type = 'page' AND Cb.cl_to REGEXP "^\\d+_births$" LEFT JOIN categorylinks Cg ON Cg.cl_from = page_id AND Cg.cl_type = 'page' AND Cg.cl_to REGEXP ("[gG]iven_name|(Chinese|Japanese|Korean|Vietnamese)-language_surnames") WHERE page_is_redirect = 0 AND page_namespace = 0 AND NOT EXISTS (SELECT 1 FROM redirect, page Pr, categorylinks Cr WHERE rd_from = page_id AND rd_namespace = 0 AND Pr.page_namespace = 0 AND Pr.page_title = rd_title AND Cr.cl_from = Pr.page_id AND Cg.cl_type = 'page' AND Cg.cl_to REGEXP ("[gG]iven_name|(Chinese|Japanese|Korean|Vietnamese)-language_surnames")) GROUP BY first_word HAVING first_word NOT REGEXP "\\.$" AND people >= 50 AND COUNT(Cg.cl_to) = 0 ORDER BY people DESC, first_word;
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...