Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Which languages have the most terms with redundant head parameter
by
Erutuon
This query is marked as a draft
This query has been published
by
Erutuon
.
Toggle Highlighting
SQL
select language, count, -- lemma_count, nonlemma_count, -- round(cast(count as float) / cast(lemma_count + nonlemma_count as float), 2) as fraction entry_count, round(cast(count as float) / cast(entry_count as float), 2) as fraction from ( select language, count(*) as count from ( select substring(cl_to, 1, instr(cl_to, '_terms_with_redundant_head_parameter') - 1) as language from categorylinks where cl_to like '%\_terms\_with\_redundant\_head\_parameter' ) as category_appearances group by language order by count desc ) as languages /* left join ( select lemma_language, count(*) as lemma_count from ( select substring(cl_to, 1, instr(cl_to, '_lemmas') - 1) as lemma_language, cl_from from categorylinks where cl_to like '%\_lemmas' group by cl_from ) as lemmas ) as lemmas on lemma_language = language join ( select nonlemma_language, count(*) as nonlemma_count from ( select substring(cl_to, 1, instr(cl_to, '_non-lemma_forms') - 1) as nonlemma_language, cl_from from categorylinks where cl_to like '%\_non-lemma\_forms' group by cl_from ) as nonlemmas ) as nonlemmas on nonlemma_language = language; */ left join ( select entry_language, count(*) as entry_count from ( select substring(cl_to, 1, coalesce(nullif(instr(cl_to, '_lemmas'), 0), instr(cl_to, '_non-lemma_forms')) - 1) as entry_language, cl_from from categorylinks where cl_to like '%\_lemmas' or cl_to like '%\_non-lemma\_forms' group by cl_from, entry_language ) as entries group by entry_language ) as entries on entry_language = language;
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...