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
Matěj Suchánek
.
Toggle Highlighting
SQL
USE wikidatawiki_p; SELECT first_names.term_text, surnames.term_text, first_names.epp_entity_id, "P1533", surnames.epp_entity_id FROM (SELECT term_text, epp_entity_id FROM pagelinks AS pl1 JOIN wb_entity_per_page ON pl_from = epp_page_id JOIN wb_terms ON term_entity_id = epp_entity_id LEFT JOIN (SELECT * FROM pagelinks WHERE pl_title = "P1533") AS withoutP1533 ON withoutP1533.pl_from = epp_page_id WHERE pl1.pl_title IN ("Q202444","Q12308941","Q11879590") AND term_type = "label" AND withoutP1533.pl_title IS NULL) AS first_names CROSS JOIN (SELECT term_text, epp_entity_id FROM pagelinks JOIN wb_entity_per_page ON pl_from = epp_page_id JOIN wb_terms ON term_entity_id = epp_entity_id WHERE pl_title = "Q101352" AND term_type = "label") AS surnames WHERE surnames.term_text = first_names.term_text GROUP BY first_names.term_text# HAVING COUNT(DISTINCT first_names.term_text) = 1 AND COUNT(DISTINCT surnames.term_text) = 1 LIMIT 50;
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...