Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Personenkategorien Gender Ratio + Non binary
by
Yi7cuGhe
This query is marked as a draft
This query has been published
by
Yi7cuGhe
.
Toggle Highlighting
SQL
/*SELECT * FROM page WHERE page_namespace = 14 AND page_title = 'Person'*/ WITH recursive personenkategorien as ( SELECT p.page_title FROM categorylinks cl JOIN page p ON p.page_id = cl.cl_from WHERE cl_type = 'subcat' and cl_to = 'Person' UNION SELECT p.page_title FROM categorylinks cl JOIN personenkategorien as pk ON pk.page_title = cl.cl_to JOIN page p ON p.page_id = cl.cl_from WHERE cl_type = 'subcat' ), people as ( SELECT cl_from, cl_to as gender FROM categorylinks WHERE cl_to IN ('Mann', 'Frau') ) SELECT cl.cl_to, p.gender, count(distinct cl.cl_from) pages FROM categorylinks cl /*JOIN personenkategorien pk ON cl.cl_to = pk.page_title*/ JOIN people p ON cl.cl_from = p.cl_from GROUP BY 1, 2
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...