SQL
AخA
USE enwiki_p;
SELECT p.page_id FROM page p
INNER JOIN categorylinks c ON c.cl_from = p.page_id AND c.cl_to = 'All_free_media'
INNER JOIN templatelinks t ON t.tl_from = p.page_id AND t.tl_namespace = 10 AND t.tl_title IN
('Non-free_use_rationale', 'Non-free_use_rationale_2', 'Non-free media rationale')
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.