Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Malayalam Wikipedia Articles without images
by
Gnoeee
This query is marked as a draft
This query has been published
by
Gnoeee
.
Toggle Highlighting
SQL
-- Step 1: Get the list of all articles in the "Critically_endangered_plants" category SELECT DISTINCT a.page_title FROM page a WHERE a.page_namespace = 0 AND a.page_id IN ( -- Step 2: Check for the images used in those articles SELECT DISTINCT p.page_id FROM imagelinks i JOIN page p ON i.il_from = p.page_id WHERE i.il_from_namespace = 0 AND p.page_namespace = 0 ) AND NOT EXISTS ( -- Step 5: Remove articles where the images match those used in the templates SELECT 1 FROM templatelinks t JOIN imagelinks i ON t.tl_from = i.il_from JOIN page p ON t.tl_from = p.page_id WHERE i.il_from_namespace = 10 AND p.page_namespace = 0 AND a.page_id = t.tl_from ); -- Step 3: Get the templates used in the "Critically_endangered_plants" category SELECT DISTINCT t.tl_from FROM templatelinks t JOIN categorylinks c ON t.tl_from = c.cl_from WHERE t.tl_namespace = 10 AND c.cl_to = 'Critically_endangered_plants' AND t.tl_from IN ( -- Step 4: Check for the images used in those templates SELECT DISTINCT il_from FROM imagelinks WHERE il_from_namespace = 10 AND il_from = t.tl_from );
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...