Wikipedia:Database queries: Difference between revisions

Content deleted Content added
No edit summary
m Reverted edits by Msghauri3 (talk) to last version by GZWDer
Line 1:
{{shortcut|WP:SQL}}
SELECT CONCAT("Wikipedia:",cur_title) AS cur_title FROM cur
 
WHERE cur_namespace=4 AND cur_is_redirect=0 ORDER BY
{{nutshell|Queries can be run against the Wikipedia database in a variety of ways}}
cur_title
 
== Overview ==
 
Much of the data that makes up the Wikipedia encyclopaedia is stored in a [[SQL database]]. It can sometimes be useful to run queries against this database to extract information that is otherwise hard to find. For example:
 
* Articles with ''H.M.S.'' in their title that have not been edited for 12 months.
* [[WP:Redirect|Redirects]] with fewer than 20 incoming links that redirect to [[WP:Category|categories]]
* All [[WP:Red link|red links]] on pages within the scope of a particular [[WP:WikiProject|WikiProject]]
 
Many simple queries can be run directly using the tools built into the [[MediaWiki]] package used by Wikipedia. Some of the most popular and useful queries are run regularly and can be found at [[Wikipedia:Database reports]]. If neither of these suits your query, you can request that someone run a query for you, or download your own copy of the database to work on.
 
== Using the MediaWiki tools ==
Some queries can be satisfied through the MediaWiki interface:
 
* [http://en.wikipedia.org/w/index.php?title=Special:Search&search=&fulltext=Search&profile=advanced&redirs=1 Search in advanced mode]
* [[Special:PrefixIndex|All pages with prefix]]
* [[Special:CategoryTree|Category tree]]
* [[mw:API|MediaWiki API]] (see [[Special:ApiSandbox]])
 
== Queries that are already run regularly ==
Useful queries that are regularly run can be found at:
 
* [[Special:SpecialPages]]
* [[Wikipedia:Database reports]]
* [[Wikipedia:Statistics]]
 
And many other places.
 
== Requesting that a query be run ==
Some Wikipedians have the ability to run queries on a copy of the live database on the [[WP:Wikimedia Labs|Wikimedia Labs]]. You may request they do this at [//quarry.wmflabs.org/ Quarry].