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 cswiki_p; SELECT tl_title, CONCAT("P", pi_property_id), SUM(IF(pp_value IS NULL, 0, 1)) / COUNT(DISTINCT tl_from) AS having_items, SUM(IF(pl_title IS NULL, 0, 1)) / SUM(IF(pp_value IS NULL, 0, 1)) AS having_prop FROM (SELECT * FROM templatelinks WHERE tl_title LIKE "Infobox&_-%" ESCAPE "&" AND tl_title NOT LIKE "%/%" AND tl_from_namespace = 0) AS ibox LEFT JOIN (SELECT * FROM page_props WHERE pp_propname = "wikibase_item") AS props ON pp_page = tl_from LEFT JOIN wikidatawiki_p.wb_property_info ON tl_title LIKE "Infobox%" LEFT JOIN wikidatawiki_p.page ON pp_value IS NOT NULL AND page_title = pp_value AND page_namespace = 0 LEFT JOIN wikidatawiki_p.pagelinks ON pl_from IS NOT NULL AND pl_from = page_id AND pl_namespace = 120 AND pl_title = CONCAT("P", pi_property_id) WHERE tl_title = "Infobox_-_motorová_lokomotiva" GROUP BY tl_title, pi_property_id HAVING having_prop > 0.3 #ORDER BY having_items, having_prop, tl_title LIMIT 100; /*SELECT DISTINCT pl_title, pl_namespace, COUNT(DISTINCT pl_from) AS linked_from, COUNT(DISTINCT log_id) AS times_deleted FROM logging JOIN pagelinks ON pl_title = log_title AND pl_namespace = log_namespace LEFT JOIN page ON page_title = pl_title AND page_namespace = pl_namespace WHERE log_type = "delete" AND log_action = "delete" AND page_title IS NULL AND pl_from_namespace = 0 GROUP BY pl_title, pl_namespace ORDER BY linked_from DESC, times_deleted DESC, pl_title, pl_namespace LIMIT 500; SELECT * FROM page AS uncategorized JOIN categorylinks ON cl_from = page_id JOIN page AS categories ON cl_to = categories.page_title AND categories.page_namespace = 14 LEFT JOIN (SELECT * FROM page_props WHERE pp_propname = "hiddencat") AS props ON pp_page = categories.page_id HAVING SUM(IF(pp_propname = "hiddencat", 1, 0)) = COUNT(DISTINCT cl_to) LIMIT 5;*/
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...