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
- Paste CSV with a header row.
- Choose the database and table name.
- 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.