I am trying to find categories, which have been deleted, but still have files in them. The latter part is trivial, but how do I check that the page existed before?
Topic on Talk:Quarry
I see two possible ways:
1) check Special:Log (using EXISTS or JOIN) like
WHERE EXISTS (SELECT 1 FROM logging WHERE log_type = 'delete' AND log_action = 'delete' AND log_namespace = 14 AND log_title = cl_to)
2) check page archive
WHERE EXISTS (SELECT 1 FROM archive WHERE ar_title = cl_to AND ar_namespace = 14)