Fork of The total file size under the Library Back-Up Project on Wikimedia Commons by 維基小霸王
This query is marked as a draft This query has been published by PantheraLeo1359531.

SQL

x
 
SELECT
  IFNULL(cl.cl_to, 'Total') AS Category,
  COUNT(*) AS LikeCount,
  SUM(CAST(i.img_size AS SIGNED)) AS TotalFileSize
FROM
  page AS p
  JOIN categorylinks AS cl ON p.page_id = cl.cl_from
  JOIN image AS i ON p.page_title = i.img_name
WHERE
  cl.cl_to IN (
    SELECT page_title
    FROM categorylinks
    JOIN page ON page_id = cl_from
    WHERE (cl_to = 'Hof (Saale) by date')
    AND page_namespace = 14
  )
  AND p.page_namespace = 6
GROUP BY cl.cl_to WITH ROLLUP;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.

Checking query status...