.sql · application/sql

SQL: Structured Query Language Script

SQL (.sql) scripts contain DDL statements such as CREATE TABLE and batched INSERT INTO statements executable against relational databases.

Quick Answer: SQL (.sql) scripts contain DDL statements such as CREATE TABLE and batched INSERT INTO statements executable against relational databases. Database seeding scripts, schema migrations, and bulk INSERT imports across PostgreSQL, MySQL, and SQLite.

Structure typeTyped Code
Human readabilityHigh
Nesting supportNo
LLM token efficiencyLow
File extension.sql
MIME typeapplication/sql
Best forDatabase seeding scripts, schema migrations, and bulk INSERT imports across PostgreSQL, MySQL, and SQLite.

Strengths

  • Portable across PostgreSQL, MySQL, MariaDB, and SQLite with dialect quoting
  • Combines schema definitions and seed data inside one auditable file
  • Works offline without direct database driver connections

Trade-offs

  • Identifier quoting differs by engine (double quotes vs. backticks)
  • Substantially larger file size than raw CSV or Parquet backups
  • Requires strict string escaping to avoid syntax errors on apostrophes

References

Convert & clean SQL locally

Related engineering guides

Related Formats

All 24 formats

SQL frequently asked questions

How does identifier quoting differ between PostgreSQL, MySQL, and SQLite?

PostgreSQL and standard SQLite use double quotes ("table"), whereas MySQL uses backticks (`table`). Select your target dialect to quote identifiers safely.

Why batch SQL INSERT rows instead of emitting one statement per row?

Multi-row INSERT INTO ... VALUES (...), (...) batches dramatically speed up database seeding while keeping query sizes manageable.

How are apostrophes inside text values escaped in SQL?

Standard SQL escapes literal single quotes by doubling them (e.g. O'Reilly becomes 'O''Reilly').