SQL Script — Structured Query Language script or database dump.
Quick facts
What is .sql
A .sql file is a SQL Script — Structured Query Language script or database dump.
In the mime-db registry it maps to application/sql. When serving .sql over HTTP, set the Content-Type header as shown in Developer info below.
Related entities: it maps to application/sql and is used by PLpgSQL, PLSQL among others — and is delivered over HTTP via the Content-Type header.
How to open .sql files
Developer info
When served over HTTP, responses should set the following header:
Content-Type: application/sql
Common software that reads/writes .sql:
Relation chain
Related extensions
Related MIME types
Related programming languages
Common uses
How to edit .sql files
How to create .sql files
Example
SELECT name, age FROM users WHERE active = true;
Frequently asked questions
Common options include VS Code, DataGrip, psql. You can also open many of these files with built-in viewers or a browser.
Create a new file in any text editor or the app that owns the format and save it with the .sql extension.
application/sql is the media type identifier used for .sql files during network transfer (for example in the HTTP Content-Type header).
Sources & standards
Updated 2026-08-18
Explore this reference