This query is marked as a draft This query has been published by Elizak181.

SQL

AخA
 
SELECT CONCAT('Q', ips.ips_item_id) AS qid, 
    p.page_id AS page_id, 
    REPLACE(p.page_title, '_', ' ') AS article_title, 
    COUNT(*) AS link_count 
FROM ( SELECT * FROM pagelinks LIMIT 1000000) AS pl 
JOIN ( SELECT * FROM page LIMIT 1000000) AS p 
    ON pl.pl_target_id = p.page_id 
LEFT JOIN wikidatawiki_p.wb_items_per_site AS ips 
    ON p.page_title = ips.ips_site_page 
    AND ips.ips_site_id = 'enwiki' 
WHERE p.page_namespace = 0 
    AND ips.ips_item_id IS NOT NULL 
GROUP BY ips.ips_item_id, p.page_id, p.page_title  
ORDER BY 
    link_count DESC  
LIMIT 5000; 
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...