Wikipedia:Database queries: Difference between revisions

Content deleted Content added
No edit summary
m // Edit via WikiMirror
 
(44 intermediate revisions by 23 users not shown)
Line 1:
{{nutshell
{{shortcut|WP:SQL}}
|shortcut1=WP:DQ
 
|shortcut2=WP:SQL
{{nutshell|Queries can be run against the Wikipedia database in a variety of ways.}}
 
== Overview ==
 
Much of the data that makes up the Wikipedia encyclopaediaencyclopedia 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.
Line 11 ⟶ 12:
* 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 [[Wikipedia:Request a query|request]] that someone run a query for you, or download your own copy of the database to work on.
 
== Using the MediaWiki tools ==
Line 19 ⟶ 20:
* [[Special:PrefixIndex|All pages with prefix]]
* [[Special:CategoryTree|Category tree]]
* [http[mw://www.mediawiki.org/wiki/API |MediaWiki API]] (see [[Special:ApiSandbox]])
 
== Queries that are already run regularly ==
Line 26 ⟶ 27:
* [[Special:SpecialPages]]
* [[Wikipedia:Database reports]]
* [[Wikipedia:File Database Reports]]
* [[Wikipedia:Statistics]]
 
And many other places.
 
== Requesting thatRun a query be run ==
SomeAll Wikipedians have the ability to run queries on a copy of the live database on the [[WP:Toolserver|toolserver]].Wikimedia Cloud YouServices|Wikimedia mayCloud requestVPS]] they do this atcalled [[tswiki:Query//quarry.wmflabs.org/ service]Quarry].
 
Users with both technical access to the database and the willingness to perform queries may be found by viewing the [https://wiki.toolserver.org/w/index.php?title=Special%3AListUsers&group=query-service&limit=50 list of query-service users].
 
== Running a query yourself ==
Copies of important Wikipedia database tables are periodically made available to download. Along with an an installation of the free [[MySQL]] database software, these can be used to set up your own copy of the Wikipedia database on which you can run your own queries.
 
To do this:
 
# Download and install [[MySQL]] from [http://dev.mysql.com/downloads/ http://dev.mysql.com/downloads/] if you do not already have a local copy.
# Download the Wikipedia tables you need from [http://download.wikipedia.org download.wikipedia.org]. Details of the database structure can be found in the MediaWiki [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/tables.sql?view=markup source repository] and [http://www.mediawiki.org/wiki/Manual:Database_layout manual] at mediawiki.org.
# Create a database and import the downloaded table dumps. More instruction on how to do this can be found at [[Wikipedia:Database download]]
# Run your query
 
== Sysop queries ==
Historically, it was possible to run queries directly against the live Wikipedia database. This function was disabled in 2004{{why?}}.
 
 
== RunningRequest a query yourself ==
[[Category:Wikipedia features|{{PAGENAME}}]]
* [[Category:Wikipedia:Request databasea reportsquery]]
 
== See also ==
[[de:Wikipedia:Datenbankabfragen]]
*[[wikitech:Nova Resource:Tools/Tools/Query service]]
[[fa:ویکی‌پدیا:استخراج آمار از دیتابیس تول سرور]]
[[fr:Wikipédia:Requêtes SQL]]
[[hu:Wikipédia:Adatbázis-lekérdezések]]
[[nl:Wikipedia:SQL-opdrachten]]
[[ja:Wikipedia:データーベースクエリ]]
[[ur:منصوبہ:آموختار برائے استخراج شماریات از ٹول سرور]]
[[zh:Help:数据库查询]]