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
MarioGom
.
This query shows domains used in external links from the main namespace of Spanish Wikipedia, along with a count of how many links they appear in, as well as the number of articles containing, at least, one link to the domain. Domains are simplified to the main domain: * news.bbc.com -> bbc.com * news.bbc.co.uk -> bbc.co.uk * www.dover.nj.us -> dover.nj.us Top 2000 are shown, according to number of articles containing links to the domain.
Toggle Highlighting
SQL
USE eswiki_p; SELECT el_from AS page_id, CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(el_to, '/', 3), '://', -1), '/', 1), '?', 1), ':', 1) AS CHAR(1000) CHARACTER SET utf8) AS domain FROM externallinks WHERE -- Only links from main namespace articles el_from_namespace = 0 -- Get only fairly well-formed URLs for http and https -- and exclude IPv4 AND el_to REGEXP '^https?://[[:alnum:]]+\..*[[:alpha:]].*' LIMIT 10;
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...