Skip to main content
CSV First Aid

CSV to SQL — CREATE TABLE + INSERTs

CSV in, .sql out. Headers become column names, types are inferred from the data (INTEGER, REAL, TEXT), each row gets its own INSERT. Runs in MySQL, Postgres, and SQLite as-is.

Drop your CSV file here

or click to browse

Generates CREATE TABLE + INSERT statements.

How it works

  1. 1Drop your CSV file above. It stays in your browser — nothing is uploaded.
  2. 2CSV First Aid parses the file and generates a CREATE TABLE statement with column types inferred from data.
  3. 3Download the .sql file or copy the SQL to your clipboard.

FAQ

What SQL dialect does it use?

Standard SQL compatible with MySQL, PostgreSQL, and SQLite. Column types are inferred as TEXT, INTEGER, or REAL based on data patterns.

Does it escape special characters?

Yes. Single quotes in values are escaped as double quotes ('') per SQL standard.

Related tools