Skip to content
LovelyTools
EN

CSV to SQL CREATE TABLE

Infer column types from CSV and generate CREATE TABLE plus INSERTs.

Processed locally on your device — nothing is uploaded.

About the CSV to SQL CREATE TABLE

Importing a CSV into a database starts with a table. Paste the CSV and this tool looks at each column’s values to choose a type — INTEGER, DECIMAL, BOOLEAN, DATE or a VARCHAR sized to the longest value — and writes CREATE TABLE for PostgreSQL, MySQL, SQLite or SQL Server with the right identifier quoting.

Tick the option to add INSERT statements for every row too.

How to use the CSV to SQL CREATE TABLE

  1. Paste CSV with a header row.
  2. Choose the database and table name.
  3. Copy or download the SQL.

Features

  • Type inference
  • Four SQL dialects
  • Optional INSERTs
  • Dialect-correct booleans

Supported formats

  • Plain text

Frequently asked questions

Does it add a primary key?

No — add PRIMARY KEY, NOT NULL and indexes to suit your data.

Is my text sent anywhere?

No. Everything runs in your browser, so nothing you paste is uploaded or stored.