.sql
💻 CodeText-based

.sql File — SQL Script

application/sql

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

SQL

Drop a .sql file here or click to choose

Or drop any file to identify its extension

Expected MIME type:application/sql

Quick Facts

Extension.sql
Full NameSQL Script
MIME Typeapplication/sql
CategoryCode
TypeText-based (human-readable)
Typical Size1 KB – 10 MB
First Appeared1974

What Is a .sql File?

SQL (Structured Query Language) files contain database queries, schema definitions, data manipulation statements, and stored procedures written in the standard language for relational database management. SQL was developed at IBM in the 1970s based on Edgar Codd's relational model and has been an ISO/ANSI standard since 1986. SQL files can contain DDL (Data Definition Language) statements for creating and modifying database structures, DML (Data Manipulation Language) for querying and modifying data, DCL (Data Control Language) for managing permissions, and TCL (Transaction Control Language) for managing transactions. SQL is used with virtually every relational database system including PostgreSQL, MySQL, MariaDB, SQLite, Oracle, SQL Server, and DB2. While the core SQL standard is shared, each database system implements extensions and dialect-specific features. SQL files are used for database migrations, seed data, backup/restore operations, reporting queries, and stored procedure definitions. Modern SQL supports window functions, common table expressions (CTEs), recursive queries, JSON operations, and full-text search. SQL remains the most important language for data management and analysis in the world.

How to Open .sql Files

VS Code
DBeaver
DataGrip
pgAdmin
MySQL Workbench
any text editor

Related File Extensions

More Code File Extensions

Other code formats you might encounter

Browse File Extensions by Category

Explore our reference of 259 file extensions with details, programs, and related formats.