Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Jura1
.
Toggle Highlighting
SQL
# See also https://upload.wikimedia.org/wikipedia/commons/f/f7/MediaWiki_1.24.1_database_schema.svg # use wikidatawiki_p; SELECT SUBSTRING_INDEX(CONCAT(term_text, ' '), ' ', 1) AS label, COUNT(*) As freq, term_language As lang, CURRENT_DATE FROM pagelinks As pl1, wb_terms, wb_entity_per_page LEFT JOIN ( SELECT pl_from FROM pagelinks WHERE pl_title = 'P735' AND pl_namespace = 120 ) As allitemswithP735 ON epp_page_id = allitemswithP735.pl_from WHERE allitemswithP735.pl_from IS NULL AND pl1.pl_title = 'P27' AND pl1.pl_namespace = 120 AND pl1.pl_from = epp_page_id AND epp_entity_type = 'item' AND term_entity_id = epp_entity_id AND term_type = 'label' AND term_entity_type = 'item' AND term_language = 'fr' AND term_text not RLike '^.. .' #DJ, Li, Wu, Yu, El, Oh, Ma AND term_text Not Like 'The %' # Asian family names AND term_text Not Like 'Kim %' AND term_text Not Like 'Lee %' AND term_text Not Like 'Park %' AND term_text Not Like 'Zhang %' AND term_text Not Like 'Choi %' AND term_text Not Like 'Wang %' AND term_text Not Like 'Liu %' AND term_text Not Like 'Chen %' AND term_text Not Like 'Han %' AND term_text Not Like 'Len %' AND term_text Not Like 'Rui %' AND term_text Not Like 'Cho %' AND term_text Not Like 'Lim %' AND term_text Not Like 'Yoon %' AND term_text Not Like 'Hang %' AND term_text Not Like 'Hwang %' AND term_text Not Like 'Yang %' # prefix AND term_text Not Like 'Sir %' AND term_text Not Like 'Master %' AND term_text Not Like 'Prince %' AND term_text Not Like 'Junior %' AND term_text Not Like 'Lady %' AND term_text Not Like 'Saint %' GROUP BY SUBSTRING_INDEX(CONCAT(term_text, ' '), ' ', 1) HAVING COUNT(*)>49
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...