SQL
AخA
USE commonswiki_p;
SET @date = '20170501';
SELECT CONCAT('# [[:Category:', REPLACE(log_title,'_',' '), ']]'), log_action FROM logging
WHERE log_namespace = 14
AND SUBSTR(log_timestamp, 1, 8) = @date
AND (log_type = 'delete' AND log_action = 'delete' OR log_type = 'move')
AND log_title NOT LIKE 'Images_from_the_Geograph_British_Isles_project_needing_categories%';
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.