SQL
x
USE enwiki_p;
SELECT count(*) AS numredirs_wpmed
FROM categorylinks cl1
JOIN page tp1
ON (tp1.page_id=cl1.cl_from)
JOIN page art1
ON (tp1.page_title=art1.page_title
AND art1.page_namespace=0)
JOIN redirect
ON (art1.page_namespace=rd_namespace
AND art1.page_title=rd_title)
JOIN page art2
ON (art2.page_id=rd_from)
JOIN page tp2
ON (art2.page_title=tp2.page_title
AND tp2.page_namespace=1)
JOIN categorylinks cl2
ON (tp2.page_id=cl2.cl_from)
WHERE cl1.cl_to="All_WikiProject_Medicine_articles"
AND cl2.cl_to="All_WikiProject_Medicine_articles"
AND tp1.page_namespace=1
AND art2.page_namespace=0;
SELECT count(*) AS numredirs_all
FROM categorylinks cl1
JOIN page tp1
ON (tp1.page_id=cl1.cl_from)
JOIN page art1
ON (tp1.page_title=art1.page_title
AND art1.page_namespace=0)
JOIN redirect
ON (art1.page_namespace=rd_namespace
AND art1.page_title=rd_title)
JOIN page art2
ON (art2.page_id=rd_from)
JOIN page tp2
ON (art2.page_title=tp2.page_title
AND tp2.page_namespace=1)
WHERE cl1.cl_to="All_WikiProject_Medicine_articles"
AND tp1.page_namespace=1
AND art2.page_namespace=0;
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.