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
Abhi1718
.
Toggle Highlighting
SQL
-- Define two category variables to filter specific media files. set @cat1 := "All_media_needing_categories_as_of_20%"; set @cat2 := "Media_needing_category_review_as_of_%"; -- Select distinct information for media files based on geographic tags. select distinct -- Retrieve the title of the associated page from the 'page' table. (select page_title from page where page_id = gt_page_id) as title, gt_page_id, gt_lat, gt_lon from -- Join the 'geo_tags' and 'categorylinks' tables. geo_tags, categorylinks where -- Match 'gt_page_id' from 'geo_tags' with 'cl_from' from 'categorylinks'. gt_page_id = cl_from -- Filter for media files with specified categories, i.e., @cat1 or @cat2. and (cl_to like @cat1 or cl_to like @cat2) -- Filter specifically for media files ('cl_type' is "file"). and cl_type = "file" -- Define a geographic bounding box for India. and ( (gt_lat > 6.755 and gt_lat < 35.674 and gt_lon > 68.162 and gt_lon < 97.395) # India bounding box -- Exclude the northern part of India from the results. and not (gt_lat > 35.674 and gt_lon < 68.162) # Exclude North of India ) -- Order the results by title. order by title;
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...