Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Akaibu
.
Toggle Highlighting
SQL
SELECT page.page_id, page.page_title, page.page_len, link_data.internal_link_count, CASE WHEN IFNULL(link_data.internal_link_count, 0) > 0 THEN page.page_len / link_data.internal_link_count ELSE NULL END AS ratio FROM ( SELECT * FROM page WHERE page_namespace = 0 AND page_is_redirect = 0 AND page_id < 1000000 AND page_len > 0 ) AS page -- Filter pages before the joins LEFT JOIN page_props ON page.page_id = page_props.pp_page AND page_props.pp_propname = 'disambiguation' LEFT JOIN ( SELECT pl_from AS page_id, COUNT(*) AS internal_link_count FROM pagelinks GROUP BY pl_from ) AS link_data ON link_data.page_id = page.page_id LEFT JOIN categorylinks cl ON page.page_id = cl.cl_from AND cl.cl_to = 'All_set_index_articles' WHERE page_props.pp_page IS NULL AND cl.cl_from IS NULL GROUP BY page.page_id ORDER BY ratio DESC;
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...