Fork of Shortest good articles by Ahecht
This query is marked as a draft This query has been published by Ahecht.

SQL

AخA
 
SELECT 
    el.el_from AS page_id, 
    COUNT(CONCAT(el.el_to_domain_index, '/', el.el_to_path)) AS reference_count, 
    REPLACE(p.page_title, '_', ' ') AS 'Good article',
    p.page_len AS 'Page length'
FROM externallinks el
JOIN page p ON el.el_from = p.page_id
WHERE p.page_id IN (
    SELECT cl_from 
    FROM categorylinks 
    WHERE cl_to = REPLACE('Good articles', ' ', '_')
)
GROUP BY el.el_from, p.page_title, p.page_len
ORDER BY reference_count DESC
LIMIT 1;
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...