|
||
Sections older than 14 days may be automatically archived. |
This is a page for requesting one-off database queries for certain criteria. Users who are interested and able to perform SQL queries on the projects can provide results from the Quarry website.
You may also be interested in the following:
- If you are interested in writing SQL queries or helping out here, visit our tips page.
- If you need to obtain a list of article titles that meet a certain criteria, consider using PetScan (user manual) or the default search. Petscan can generate list of articles in subcategories, articles which transclude some template, etc.
- If you need to make changes to a number of articles based on a particular query, you can post to the bot requests page, depending on how many changes are needed.
- For long-term review and checking, database reports are available.
Level-5 Vital Articles lacking short descriptions
As suggested by Sdkb here, looking for a query that lists all articles in Category:All Wikipedia level-5 vital articles but not in Category:Articles with short description. Thank you! (I'm not watching this page – please use {{reply to|PerfectSoundWhatever}}
on reply) — PerfectSoundWhatever (t; c) 15:01, 1 June 2022 (UTC)
- Normally, you could do this with Petscan, but the level-5 category is assigned to the article's talk page. If you don't get an answer to this query request, you can go through the category page manually and show all of the short descriptions using this script. – Jonesey95 (talk) 16:26, 1 June 2022 (UTC)
- quarry:query/65002. The page not in mainspace is Category:Port Arthur massacre; Category talk:Port Arthur massacre's categorization into the v5 cat needs fixing separately. —Cryptic 20:46, 1 June 2022 (UTC)
List of pages by last update
Is it possible to obtain a list of recently updated talk pages efficiently, e.g. through SQL via page.page_latest? It could be a list of pages updated since a certain date, or a complete list of all pages with the date of last update, or possibly a list of all pages sorted by last update ranking. Per discussion Wikipedia:Bot_requests#Add_Reflist-talk_to_talk_pages_with_references. GreenC 16:21, 3 June 2022 (UTC)
- @GreenC: quarry:query/65053 lists talk pages updated since the start of this month. Fork and change the timestamp to select a different start date. It currently shows all talk namespaces but could be limited further, e.g.
page_namespace in (1, 11)
shows just (article) Talk: and Template_talk:. I've excluded redirects: including them would speed the query up but produce lots of false positives. Certes (talk) 23:52, 3 June 2022 (UTC)- This is great! Follow up at Wikipedia:Bot_requests#Add_Reflist-talk_to_talk_pages_with_references. -- GreenC 03:02, 5 June 2022 (UTC)
List of pages where page language is not the same as the last part of title
An edit request was made at m:Module talk:Template translation where Verdy p said that the language specified in the metadata of a page may not be the same with the last part of its title. For example, m:User:Tangotango/Whatredirectshere/sv is expected to be in Swedish, but MediaWiki doesn't think so. I have tried writing a query myself using this manual but page_lang
always return NULL
. NguoiDungKhongDinhDanh 03:42, 15 June 2022 (UTC)
- What precisely are you looking for? Some possible results:
- Pages without a slash, with page_lang set, like m:Die falsche Version (de); there's 64 of them
- Pages with a slash, with page_lang set, where the title after the slash doesn't match page_lang, like m:IRC/wikipedia-fr/extraits choisis (fr); there's 376
- Pages with a slash, with page_lang set, where the title after the slash doesn't match page_lang, and the part after the slash matches the page_lang of at least one other page; there aren't any
- Pages with a slash, without page_lang set, like m:10 Wikiweeks/Participants; there's about 2.7 million
- Pages with a slash, without page_lang set, and the part after the slash matches the page_lang of at least one other page, like m:Country codes/en; there's about 1.7 million
- Anything like "the part after the slash is a valid page_lang" isn't going to be possible unless there's a list of language codes already in the same database that I'm not seeing. Well, I suppose I could enumerate them all in the query, manually, but I'm not going to. —Cryptic 06:42, 15 June 2022 (UTC)
- @Cryptic: If an unset
page_lang
means that page's language is similar to that of the project, then I'm looking for pages with at least one slash, withoutpage_lang
set, where the part after the last slash isn'ten
but matches thepage_lang
of at least one other page. Honestly, I don't expect 1000, let alone 1.7 million. NguoiDungKhongDinhDanh 07:42, 15 June 2022 (UTC)- quarry:query/65375. There's some 216000 pages even after I omit namespace Translations: (which has another 1.27 million), so it'll load slow.If you want the results from the Translations namespace, we'll have to arrange some other way to get them to you; quarry can't handle that many results. —Cryptic 09:01, 15 June 2022 (UTC)
- @Cryptic:
page_lang
seems to be inconsistent with {{PAGELANGUAGE}}. For example, m:Main Page/es is clearly a Spanish translation (expand). This request is about to be out of scope for this page so perhaps I'll need to ask at WP:VPT. Thanks a lot anyway. NguoiDungKhongDinhDanh 13:20, 15 June 2022 (UTC)
- @Cryptic:
- quarry:query/65375. There's some 216000 pages even after I omit namespace Translations: (which has another 1.27 million), so it'll load slow.If you want the results from the Translations namespace, we'll have to arrange some other way to get them to you; quarry can't handle that many results. —Cryptic 09:01, 15 June 2022 (UTC)
- @Cryptic: If an unset
Pages that starts with“List of”and ends with“Canada”with“box”in the middle
I need these pages, but I don't know how to write a SQL query. Can anyone help me?--Q28 (talk) 14:21, 18 June 2022 (UTC)
- @Q28: A Cirrus query finds them (with potential false positives having other text after Canada, but I don't see any). Certes (talk) 15:19, 18 June 2022 (UTC)
- @Q28: Quarry:query/65478. Sam Walton (talk) 15:24, 18 June 2022 (UTC)