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
Mike.Khoroshun
.
Toggle Highlighting
SQL
-- Count the number of Wikidata items with gender 'man' and interwiki link to Ukrainian Wikipedia USE wikidatawiki_p; SELECT COUNT(DISTINCT pl_title) AS count FROM ( SELECT DISTINCT pagelinks.pl_title FROM pagelinks JOIN page ON page.page_id = pagelinks.pl_from WHERE pagelinks.pl_namespace = 0 AND pagelinks.pl_title = 'Q5' -- Q5 represents human AND EXISTS ( SELECT 1 FROM langlinks WHERE langlinks.ll_from = page.page_id AND langlinks.ll_lang = 'uk' ) AND EXISTS ( SELECT 1 FROM wb_claims WHERE page.page_title = wb_claims.claim_id AND wb_claims.property = 'P21' -- Property for gender AND wb_claims.value = 'Q6581097' -- Q6581097 represents male gender ) ) AS subquery;
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...