Data · .sql
What Is an SQL File?
A .sql file is a text file of database commands written in SQL.
- Extension
- .sql
- Full name
- SQL script
- Type
- Data
- MIME type
- application/sql
Free SQL Tools
These run in your browser. Your SQL files are never uploaded.
About SQL Files
A .sql file contains commands in Structured Query Language, the language used by relational databases such as MySQL, PostgreSQL, SQL Server and SQLite. Often it is a database dump: a backup that recreates tables with CREATE TABLE statements and fills them with INSERT statements. It can also be a script of queries. The file is plain text, so you can read it in an editor, but you need a database to run it.
How to Open an SQL File
- Any device
- Open it in a text editor to read it.
- Windows & Mac
- Run it with MySQL Workbench, pgAdmin, DBeaver, SQL Server Management Studio or a command-line client.
SQL File Questions
How do I import a .sql file into MySQL?
Run mysql -u user -p database < file.sql, or use Server, Data Import in MySQL Workbench.
Can I open a SQL file in Excel?
Not usefully. Import it into a database first, then export the table you need as CSV.