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
Jarekt
.
Get a list of Qid's and name of Commons creator templates based on https://commons.wikimedia.org/wiki/Category:Creator_templates_with_Wikidata_link:_item_missing_homecat so we can add it using quickstatements.
Toggle Highlighting
SQL
use commonswiki_p; SELECT iwl_title, 'P373', CONCAT("\"", REPLACE(page_title, "_", " "), "\""), 'S143', 'Q24731821' FROM page JOIN categorylinks C1 ON C1.cl_from=page_id AND C1.cl_to='Creator_templates_with_Wikidata_link:_item_missing_homecat' JOIN iwlinks ON iwl_from=page_id AND iwl_prefix='wikidata' AND iwl_title LIKE 'Q%' WHERE page_namespace=100 AND page_is_redirect=0 AND NOT EXISTS ( SELECT * FROM categorylinks C2 WHERE page_id = C2.cl_from AND C2.cl_to="Category:Creator_templates_with_non-matching_home_categories" ) LIMIT 500;
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...