Translations:Manual:Database access/141/en

You can then write out database queries. Alternatively you can provide a filename, and MediaWiki will execute it, substituting any MW special variables as appropriate.