Jump to content

Wikipedia:Request a query

Add topic
From Wikipedia, the free encyclopedia
(Redirected from Wikipedia:SQLREQ)
Latest comment: 7 days ago by Cryptic in topic Four queries

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]

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:
    1. Percentage of unreverted mainspace edits in each group in 2025
    2. Size (bytes? "readable prose size"?) of unreverted mainspace edits (total? mean? median?) in each group in 2025
    3. Number of references (ref tags? URLs?) added in 2025

WhatamIdoing (talk) 21:07, 20 July 2026 (UTC)Reply

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)Reply
Do you think that comparing the tag editcheck-newreference would 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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
Yes. —Cryptic 20:45, 22 July 2026 (UTC)Reply
Okay, I've been giving this some thought, and I want to compare new student accounts vs new non-student accounts for:
  1. 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."
  2. Mainspace edits that have visualeditor and do not have mw-reverted split by whether they also have the editcheck-newcontent tag. 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."
  3. Mainspace edits that have visualeditor split by whether or not they also have the editcheck-newreference tag. 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."
  4. 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."
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)Reply
Whichever you prefer. Will also want you to pick the time range for the actual edits. —Cryptic 01:09, 11 August 2026 (UTC)Reply
Output's going to look similar to the mockup at quarry:query/108251. —Cryptic 01:19, 11 August 2026 (UTC)Reply
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)Reply
(I haven't forgotten. Getting this list of editors to you is still on my list.) WhatamIdoing (talk) 01:06, 2 September 2026 (UTC)Reply
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)Reply

Vanished Wikipedia essay

[edit]
Resolved

Graham87 (talk) 07:00, 8 September 2026 (UTC)Reply

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 (d) 04:41, 7 September 2026 (UTC)Reply

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)Reply
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)Reply
How about searching for the word "proofread"? –LaundryPizza03 (d) 19:16, 7 September 2026 (UTC)Reply
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)Reply
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)Reply
How about rewrit%? –LaundryPizza03 (d) 04:39, 8 September 2026 (UTC)Reply
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)Reply
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)Reply
The mystery has been solved. Graham87 (talk) 07:00, 8 September 2026 (UTC)Reply

Redoing some queries

[edit]

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)Reply

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)Reply
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)Reply
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)Reply
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)Reply
quarry:query/109227. —Cryptic 21:00, 12 September 2026 (UTC)Reply

Four queries

[edit]

Cryptic, (or someone else) I am requesting the following queries. Hope this isn't too much work. If possible copy some of these to subpages of Wikipedia:Database reports:

  • A query that would list all articles created by users where their username is the same as the article title, like if User:Example were to create the article Example.
  • A version of that query only featuring articles in Category:Articles lacking sources
  • A version of that query only featuring articles also within the "Single-article users" query
  • A version of the Templateless articles query only featuring articles also within the "Single-article users" query

(Would those last two take too long?) RanDom 404 (talk) 15:00, 15 September 2026 (UTC)Reply

A query here addresses the first one. I've taken "articles" to mean "mainspace pages which are not currently redirects". As for the second one, my effort purports to show that there aren't any, but that may well be a bug. (Do you have any examples?) I've not attempted the third or fourth queries. Someone may like to combine the single-user query above with this query once the definitions are clear. Certes (talk) 16:00, 15 September 2026 (UTC)Reply
That's going to be missing just about all article titles with spaces in them. actor_name is usually like user_name in that it doesn't replace spaces with underscores the way page_title does. Most (all?) exceptions are from imported edits, which is why Enter_the_Dragon is the only one in your results that shows up. —Cryptic 16:09, 15 September 2026 (UTC)Reply
D'oh, I should have spotted that they were all single words! Thank you. There is also the issue of what is an "article": many pages have switched between article, redirect and dab over the years and it might be pragmatic just to declare that anything with rev_len > 100 was created as an article. And I expect many of them have had a page move which means the current title doesn't match that at creation. A bit of a minefield calling for many heuristics. Certes (talk) 16:26, 15 September 2026 (UTC)Reply
User renames is also a stumbling block, and harder to detect. —Cryptic 16:50, 15 September 2026 (UTC)Reply