Wikipedia:Request a query
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 pages that meet certain criteria, consider using PetScan (user manual) or the default search. PetScan can generate lists 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.
The database replicas do not have access to page content, so requests which require checking wikitext cannot be answered with database queries. In particular, there is no way to query for template parameters or anything related to references. However, someone may be able to assist by querying in another way (for example, checking for external links rather than references) or suggest an alternative tool.
Net unreverted article contributions
[edit source]Is any of this even possible?
- Groups:
- Registered accounts created in 2025 that made 1+ edits in 2025
- Student accounts created in 2025 that made 1+ edits in 2025
- Measurements:
- Percentage of unreverted mainspace edits in each group in 2025
- Size (bytes? "readable prose size"?) of unreverted mainspace edits (total? mean? median?) in each group in 2025
- Number of references (ref tags? URLs?) added in 2025
WhatamIdoing (talk) 21:07, 20 July 2026 (UTC)
- Mostly. I'd need a manual list of student accounts. Detecting "unreverted" would only go by the presence of the mw-reverted tag, so not, for example, one where it took more than... 30?... days to revert, nor one where the reverting edit didn't exactly match a previous revision, like undoing an edit where an unrelated intervening edit is left intact. Only way to detect size of an edit is by looking at the size of revisions, so reverting a page blanking is an addition the size of the previous page, while completely rewriting a page in-place will often look like removing bytes. Ref tags aren't detectable at all, and the only visibility of external links is of those currently on a page, so that's not possible at all. —Cryptic 21:44, 20 July 2026 (UTC)
- Do you think that comparing the tag
editcheck-newreferencewould be fair? I think that only turns up for edits in the visual editor, and I don't know if the two groups use the visual editor in approximately equal amounts. WhatamIdoing (talk) 21:13, 21 July 2026 (UTC)- I was going to say that I'd never seen that tag in the wild, but it seems it's set up not to display anyway (why?!), so I wouldn't have. And also have no idea how common it is or isn't. So I can't begin to guess. —Cryptic 21:35, 21 July 2026 (UTC)
- Visual editor only, but both desktop and mobile. phab:T325713#8718860 has an explanation for keeping it hidden. That was three years ago, and it's triggered about three million times since then, so it's about 1K per day on average. However, if 100% of students use the visual editor and 100% of non-student newbies don't, then that wouldn't produce a useful response. Consequently, this might add another needed datapoint: What percentage of edits were in the visual editor for the two groups? WhatamIdoing (talk) 21:58, 21 July 2026 (UTC)
- Tell you what. Give me a list of tags (internal names are easiest) and groups, and I can give you totals for every combination of them. —Cryptic 22:38, 21 July 2026 (UTC)
- Is "editcheck-newreference" (in the "Tag name" column of Special:Tags) what you mean by internal name? WhatamIdoing (talk) 18:32, 22 July 2026 (UTC)
- Tell you what. Give me a list of tags (internal names are easiest) and groups, and I can give you totals for every combination of them. —Cryptic 22:38, 21 July 2026 (UTC)
- Visual editor only, but both desktop and mobile. phab:T325713#8718860 has an explanation for keeping it hidden. That was three years ago, and it's triggered about three million times since then, so it's about 1K per day on average. However, if 100% of students use the visual editor and 100% of non-student newbies don't, then that wouldn't produce a useful response. Consequently, this might add another needed datapoint: What percentage of edits were in the visual editor for the two groups? WhatamIdoing (talk) 21:58, 21 July 2026 (UTC)
- I was going to say that I'd never seen that tag in the wild, but it seems it's set up not to display anyway (why?!), so I wouldn't have. And also have no idea how common it is or isn't. So I can't begin to guess. —Cryptic 21:35, 21 July 2026 (UTC)
- Do you think that comparing the tag
- Okay, I've been giving this some thought, and I want to compare new student accounts vs new non-student accounts for:
- Mainspace edits (i.e., to any page presently in the mainspace) that have
mw-reverted. The goal is a sentence such as: "New student accounts were n% as likely to have their edits reverted as new non-student accounts." - Mainspace edits that have
visualeditorand do not havemw-revertedsplit by whether they also have theeditcheck-newcontenttag. The goal is a sentence such as: "New student accounts using the visual editor were n% as likely to add unreverted content to an article than new non-student accounts using the visual editor." - Mainspace edits that have
visualeditorsplit by whether or not they also have theeditcheck-newreferencetag. The goal is a sentence such as: "Edits from new student accounts using the visual editor were n% as likely to add a ref than edits from new non-student accounts using the visual editor." - Mainspace edits (in any editing environment) that have
possible unreferenced addition to BLP. The goal is a sentence such as "New student accounts were n% as likely to make unsourced BLP content as new non-student accounts."
- Mainspace edits (i.e., to any page presently in the mainspace) that have
- The first two are measurements of overall edit quality (Did it get reverted? If it didn't get reverted, did the edit add a significant amount of content, or just tweak something small?), and the second two are measures of adding sources (Did they add refs? In BLPs specifically?).
- I'll have to assemble a list of student usernames for you. Do you want them from a calendar year or from a school year? WhatamIdoing (talk) 23:57, 10 August 2026 (UTC)
- Whichever you prefer. Will also want you to pick the time range for the actual edits. —Cryptic 01:09, 11 August 2026 (UTC)
- Output's going to look similar to the mockup at quarry:query/108251. —Cryptic 01:19, 11 August 2026 (UTC)
- About the time range, I think it should be at least "months" ago, so there's plenty of time for a bad edit to get noticed and reverted. At minimum, that feels like September for classes ending in June. I'll have a clearer answer when I assemble the list of students. WhatamIdoing (talk) 01:54, 11 August 2026 (UTC)
- (I haven't forgotten. Getting this list of editors to you is still on my list.) WhatamIdoing (talk) 01:06, 2 September 2026 (UTC)
- Tangential, I know, but the reverted tag is not in any way time-limited and does apply to edits undone using the "undo" feature. See these edits for a demonstration; the user I was reverting was almost certainly acting in good faith. Graham87 (talk) 10:09, 7 September 2026 (UTC)
- Whichever you prefer. Will also want you to pick the time range for the actual edits. —Cryptic 01:09, 11 August 2026 (UTC)
Newcomer reversions in math articles
[edit source]I'm looking for (what I think is) a simple query:
- All articles tagged by Wikipedia:WikiProject Mathematics
- Edits tagged with
newcomer task add link - Split by whether the edit has been reverted
- First half of this calendar year
My goal is a sentence that sounds like "Looking at the math-related articles, I see 1,234 edits with this newcomer task this year, and 5% of them were reverted". WhatamIdoing (talk) 01:12, 2 September 2026 (UTC)
- quarry:query/108882. Few enough that I could give you a list of diffs. —Cryptic 02:19, 2 September 2026 (UTC)
- Thanks. It looks like 11 add-a-link edits were made each day, and about three of them were reverted each week, or 4%. Both numbers might go up if this is run later, since we recently changed the number of suggested links (to limit it to one link per edit, to make reverting easier).
- I'll let you know if I need the list of individual diffs. WhatamIdoing (talk) 00:07, 3 September 2026 (UTC)
WikiProject Korea-related vital articles
[edit source]After seeing Korea-related vital articles such as Yi Wanyong, Miracle on the Han River, Tan'gun, Yongin, etc. in awful conditions, I decided it would be nice to have a list of Korea related vital articles so I can keep an eye on any that I wish to improve.
The query should generate a list of English Wikipedia articles that meet these following conditions:
- Is a Vital article
- Falls within the scope of WikiProject Korea (namely, listed in User:WP 1.0 bot/Tables/Project/Korea-related)
- Not a WP:GA, WP:FA or WP:FL
~delta {talk • cont • 🇰🇷 • 🎢} 00:49, 3 September 2026 (UTC)
- I'm not familiar with WP 1.0 bot. I take it that being linked from that page is equivalent to having a talk page tagged {{WikiProject Korea}}? (The numbers roughly match up.) —Cryptic 01:43, 3 September 2026 (UTC)
- Yes, indeed. ~delta {talk • cont • 🇰🇷 • 🎢} 01:47, 3 September 2026 (UTC)
- quarry:query/108907. 331 level-5, 59 level-4, and 3 (Confucianism, East Asia, and South Korea) level-3. —Cryptic 02:01, 3 September 2026 (UTC)
- Yes, indeed. ~delta {talk • cont • 🇰🇷 • 🎢} 01:47, 3 September 2026 (UTC)
Homonymous project pages
[edit source]I'd like a list of every homonymous non-redirect page in both the Help: and Wikipedia: namespaces, such as WP:Books and Help:Books. We need this at Wikipedia talk:Requests for comment § Deprecate the Help: namespace. FaviFake (talk) 20:29, 4 September 2026 (UTC)
- It looks like there are 28 such pairs, although I haven't verified them all, just a random handful. J11csd (talk) 21:46, 4 September 2026 (UTC)
- Having checked a bit further, it appears that about one third of these pairs are both soft redirects to other Wikimedia projects. J11csd (talk) 23:12, 4 September 2026 (UTC)
- Thanks!
- I see these real links:
- and these soft redirects to another wiki:
- WhatamIdoing (talk) 00:48, 6 September 2026 (UTC)
- Having checked a bit further, it appears that about one third of these pairs are both soft redirects to other Wikimedia projects. J11csd (talk) 23:12, 4 September 2026 (UTC)
Vanished Wikipedia essay
[edit source]Graham87 (talk) 07:00, 8 September 2026 (UTC)
I'm looking for a Wikipedia essay about AI proofreading that was overwritten or deleted. Nothing is known about its title, but it was likely in userspace or project space. I'd suggest searching for pages that were once Wikipedia essays but were subsequently deleted or overwritten. See Wikipedia_talk:WikiProject_AI_Cleanup#Lumberjack_essay_about_AI_proofreading. –LaundryPizza03 (dc̄) 04:41, 7 September 2026 (UTC)
- I was the one who suggested this venue; as I said at the above discussion, I'm not that good at queries. However, I know that we can't ask for most of those things, primarily because the wiki replicas don't store any revision text. However, we can establish that if the essay was deleted, it didn't contain "lumberjack" in its title at the time of its deletion, unless I'm really missing something. I think all we can do is nibble at the edges of the question, but database queries seem like the least bad method of nibbling, if that makes any sense, because regular searches haven't been fruitful. Graham87 (talk) 08:32, 7 September 2026 (UTC)
- Per the discussion where @Gnomingstuff: said they contributed to the page, here's a list of deleted edits by Gnomingstuff outside the article and talk namespaces, ordered by length of the text in bytes, longest first. I can't find anything promising in the first two pages of that list though, but maybe it might ring a bell to someone else. A key to the namespace numbers can be found at Wikipedia:Namespace. Graham87 (talk) 09:48, 7 September 2026 (UTC)
- How about searching for the word "proofread"? –LaundryPizza03 (dc̄) 19:16, 7 September 2026 (UTC)
- Nope. If you log in to Quarry, fork my query, and replace the search string in the SQL with something different, you can conduct your own searches like this, but they're fairly slow ... and as I said at the other discussion, the chance that a page like that would've been outright deleted is very, very low anyway. Graham87 (talk) 03:02, 8 September 2026 (UTC)
- Much faster if you give it a namespace. Adding
AND ar_namespace IN (2, 4)cuts runtime down to a few seconds. And LOWER(ar_title) won't work since ar_title isn't text; LIKE is case-insensitive anyway, for types that have cases. Convert it to utf8mb4. Here you go. Nothing recent. —Cryptic 03:26, 8 September 2026 (UTC)- How about rewrit%? –LaundryPizza03 (dc̄) 04:39, 8 September 2026 (UTC)
- Much faster if you give it a namespace. Adding
- Nope. If you log in to Quarry, fork my query, and replace the search string in the SQL with something different, you can conduct your own searches like this, but they're fairly slow ... and as I said at the other discussion, the chance that a page like that would've been outright deleted is very, very low anyway. Graham87 (talk) 03:02, 8 September 2026 (UTC)
- Ironically with AI assistance, inspired by the deleted edits query above, I tried making a list of distinct live pages @Gnomingstuff: had edited sorted by the maximum page size when they edited them, at first in all namespaces besides user and talk restricted to 2026, then, inspired by the above messages which I noticed in the meantime, just in the Wikipedia and user namespaces with no timestamp restriction. . Here's the first one, followed by the second; I went down to a few thousand bytes on both and couldn't find anything that grabbed my attention. Graham87 (talk) 04:50, 8 September 2026 (UTC)
- Hi - I appreciate your doing this, since I don't really have time to go through these myself, but there's no need to ping me. Gnomingstuff (talk) 04:53, 8 September 2026 (UTC)
Redoing some queries
[edit source]Cryptic, (or someone else) could you someone redo these six queries from last year, and this time publish them in continuously updated database report pages? RanDom 404 (talk) 15:06, 12 September 2026 (UTC)
- User:RanDom 404/Single-article editors for the category-based ones.SDZeroBot has a low enough max query time that the first set, over all of mainspace, couldn't possibly finish unless split into very small batches, no more than one or maybe two letters each. And those would eventually break too. —Cryptic 17:02, 12 September 2026 (UTC)
- Thank you! Can an additional query be made for articles created by users whose other edits were all reverted? RanDom 404 (talk) 18:05, 12 September 2026 (UTC)
- Two variants, at quarry:query/109222 and quarry:query/109224. The second also allows unreverted edits to the same article. Both are very inaccurate, since most of 2001's history is lost (e.g. Special:Permalink/343672423 is the oldest edit in Belgium's history, but probably wasn't its actual creation), and since edits only started getting tagged as reverted in 2021. Neither is well-suited for running through {{database report}}. —Cryptic 20:04, 12 September 2026 (UTC)
- That is a massive list. Could you create a version of the first of the two queries where the article must be part of Category:Articles lacking sources? RanDom 404 (talk) 20:09, 12 September 2026 (UTC)
- Two variants, at quarry:query/109222 and quarry:query/109224. The second also allows unreverted edits to the same article. Both are very inaccurate, since most of 2001's history is lost (e.g. Special:Permalink/343672423 is the oldest edit in Belgium's history, but probably wasn't its actual creation), and since edits only started getting tagged as reverted in 2021. Neither is well-suited for running through {{database report}}. —Cryptic 20:04, 12 September 2026 (UTC)
- Thank you! Can an additional query be made for articles created by users whose other edits were all reverted? RanDom 404 (talk) 18:05, 12 September 2026 (UTC)