Wikipedia:Request a query

From Wikipedia, the free encyclopedia
  (Redirected from Wikipedia:RAQ)
Jump to navigation Jump to search

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.

Documentaries with plot sections[edit]

Would it be possible to take the list here and filter it to only contain entries that have the wikitext "==Plot==" or "== Plot =="? {{u|Sdkb}}talk 02:23, 28 April 2022 (UTC)[reply]

Not with a query - there's no access to page text. —Cryptic 08:40, 28 April 2022 (UTC)[reply]
Actually, correcting myself slightly - we can see section names in the very limited case where there's a redirect to that section. There's 94 redirects to sections of those articles, none named "Plot"; the closest there is is Riley ReynoldsHot Girls Wanted#Synopsis. —Cryptic 14:16, 28 April 2022 (UTC)[reply]

Edit summaries[edit]

Hi, I'd like to know if I can find out how many times a particular edit summary from a popular semi-automated tool has been used. Ohconfucious's MOS:NUMDATES script's former edit summary was: date formats per [[MOS:DATEFORMAT]] by [[WP:MOSNUMscript|script]] (date formats per MOS:DATEFORMAT by script). Dawnseeker2000 21:30, 8 May 2022 (UTC)[reply]

A quick check through recent changes shows 3300 in the last month (quarry:query/64419). A full check is likely to take much longer. Certes (talk) 00:05, 9 May 2022 (UTC)[reply]
quarry:query/64420 can be limited to date ranges and takes about 2 seconds per day, or 12 minutes per year, so could be run in sections. That text started to appear on 10 December 2014, so nine one-year runs might work. Certes (talk) 00:25, 9 May 2022 (UTC)[reply]
Thank you sir. Dawnseeker2000 06:51, 9 May 2022 (UTC)[reply]

Queries[edit]

Hello, folks,

Is it possible to run a query on my own contributions and logs? This is not for a higher purpose, I am just curious about how many Teahouse invitations I've posted (I think it's in the tens of thousands) so I'd run a query to see how many of my edit summaries state "Welcome to Wikipedia: check out the Teahouse!" since that is the default edit summary when posting an invitation. I'm also curious about the pages that I've deleted, if I could run a query on the deletion summaries on Special:Log/Liz to see the proportion that were based on a particular speedy deletion criteria or whether they were deleted PRODs or because of an AfD decision. This query might be more complicated because sometimes multiple CSD criteria are listed in a deletion summary or the wording is not concise. But I don't think I've ever left a blank deletion summary so there would be some reason listed for every page deletion I've made.

If these tools are really intended to help manage the project, I understand that my request is purely personal. It's just that my edit count is growing and I know at a certain point in the future, Edit Count will no longer be available for me to see my how my edits breakdown so I thought I'd inquire about these two queries before my edit counts and log entries become too large for these to be practical requests.

Many thanks for any feedback you have, even if you tell me that these results are not possible to obtain. I'm constantly in awe of editors and admins who create bots or write scripts and make tools which make our editing here so much easier and simple. Your talents are appreciated! Thanks again. Liz Read! Talk! 20:24, 9 May 2022 (UTC)[reply]

For the first request, you can use https://sigma.toolforge.org/summary.py (which is linked as "edit summary search" at the bottom of your contributions page). I'll let someone else handle the second request. Oh, and you can still use WikiScan to get similar information to what the edit count report provides when you cross its limit. * Pppery * it has begun... 20:43, 9 May 2022 (UTC)[reply]
For your CSD counts, here's an approximation I wrote in SQL. To refresh these numbers in the future, log in to Quarry, click "fork", then click "Submit query". –Novem Linguae (talk) 22:17, 9 May 2022 (UTC)[reply]

Quarry : subpages[edit]

Hey, I'm trying to list French sub talkpages 'À_faire' (like fr:Discussion:Dantès/À faire) that still exists while talkpage (like fr:Discussion:Dantès) OR main page (like fr:Dantès) doesn't exist.

I started with :

SELECT page_title
FROM page talkpage
WHERE talkpage.page_title LIKE '%/À_faire'
AND talkpage.page_namespace IN (1,5,11,15,101,119,711,829)

But, I'm not able to end this SQL query with NOT EXISTS in order to check :

Maybe this is a starting point :

AND NOT EXISTS (
SELECT 1
FROM page mainpage
WHERE mainpage.page_namespace=talkpage.page_namespace-1
AND mainpage.page_title=talkpage.page_title)

But... it's going to list French sub talkpages 'À_faire' WHEN pages like fr:Dantès/À faire doesn't exist BUT that's not what I'm looking for. I need to check IF fr:Dantès OR fr:Talk:Dantès doesn't exist instead. Any clue?

Thank's --LD (talk) 22:10, 12 May 2022 (UTC)[reply]

This should show '/À_faire' pages where neither fr:Dantès nor fr:Talk:Dantès exists.
AND NOT EXISTS (
SELECT 1
FROM page mainpage
WHERE mainpage.page_namespace IN (talkpage.page_namespace-1, talkpage.page_namespace)
AND mainpage.page_title=SUBSTRING(page_title,1,CHAR_LENGTH(page_title)-8))
8 here is short for CHAR_LENGTH('/À_faire'). Did you also want to see pages where one of the two exists but not the other? Certes (talk) 22:50, 12 May 2022 (UTC)[reply]
Thank's for answering @Certes, yeah also would like to see that LD (talk) 22:59, 12 May 2022 (UTC)[reply]
AND (NOT EXISTS (SELECT 1 FROM page mainpage
    WHERE mainpage.page_namespace = talkpage.page_namespace-1
    AND mainpage.page_title=SUBSTRING(page_title,1,CHAR_LENGTH(page_title)-8))
 OR NOT EXISTS (SELECT 1 FROM page mainpage
    WHERE mainpage.page_namespace = talkpage.page_namespace
    AND mainpage.page_title=SUBSTRING(page_title,1,CHAR_LENGTH(page_title)-8)))
I.e. AND (NOT EXISTS(main page) OR NOT EXISTS(talk page)) Certes (talk) 23:02, 12 May 2022 (UTC)[reply]
@Certes, thank's again. Erm, something might be wrong, i.e. query listed fr:Discussion:'Pataphysique/À_faire while main page fr:'Pataphysique and fr:Discussion:'Pataphysique exist.
It rather should list <any talk subpage 'À_faire'> WHEN <any main page> AND+OR <any talk page> doesn't exist. LD (talk) 23:20, 12 May 2022 (UTC)[reply]
Try quarry:query/64526. Although documented as working on characters, SUBSTRING seems to work on bytes, so multi-byte characters like À give the wrong answer. Certes (talk) 23:48, 12 May 2022 (UTC)[reply]
Thank's for solving that, @Certes, I really appreciated! LD (talk) 00:16, 13 May 2022 (UTC)[reply]