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
維基小霸王
.
https://commons.wikimedia.org/wiki/Commons:Library_back_up_project
Toggle Highlighting
SQL
SELECT super_category.cl_to AS SuperCategory, category.cl_to AS SubCategory, COUNT(*) AS LikeCount, SUM(CAST(img_size AS SIGNED) / (1 << 30)) AS TotalFileSizeTB FROM page AS p JOIN categorylinks AS super_category ON p.page_id = super_category.cl_from JOIN categorylinks AS category ON p.page_id = category.cl_from JOIN image AS i ON p.page_title = i.img_name WHERE super_category.cl_to = "Library_back_up_project" AND category.cl_to IN ( SELECT cl_to FROM categorylinks WHERE cl_from = ( SELECT page_id FROM page WHERE page_title = "Library_back_up_project" AND page_namespace = 14 -- Assuming the category is in the Category namespace (namespace 14) LIMIT 1 ) ) AND p.page_namespace = 6 -- Assuming file information is in the File namespace (namespace 6) GROUP BY SuperCategory, SubCategory ORDER BY SuperCategory, SubCategory;
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...