Skip to main content
Input CSV
Trascina un CSV qui oppure
Output SQL

Come utilizzare CSV to SQL

Attach or load CSV

Attach text CSV or drag a .csv or .txt file. The delimiter is automatically detected by comparing comma, period and comma, tab and pipe.

Choose table and SQL dialect

Set table name and select destination dialect (PostgreSQL, MySQL or SQLite): changes the syntax of generated identifiers and types.

Review and correct raised columns

Every column is analyzed to infer the SQL type (INTEGER, DECIMAL, BOOLEAN, DATE, VARCHAR, TEXT). You can exclude columns or manually correct the type before generating the SQL.

Generate Create Table and Insert

View complete output (CREATE + INSERT), only CREATE or configurable INSERTs in batches, then copy or download the SQL file.

Suggerimenti

  • Use "Load Example" to view a pre-converted dataset with names, emails, dates and booleans.
  • Column names are sanitized automatically (lowercase, underscores, no special characters) to be valid as SQL identifiers.
  • If a date column is not recognized, verify that all values follow the same format (yyyy-mm-dd, dd/mm/yyyy or dd-mm-yyyy).

Domande frequenti

How is the SQL type of each column detected?

The tool analyzes all non-empty values in the column in order of priority: boolean (true/false/0/1/yes/no), integer, decimal, date (formatted ISO, mm/dd/yyyy, mm-dd-yyyy), and finally VARCHAR or TEXT based on the maximum length found (over 255 characters becomes TEXT).

What difference is there between the dialects of PostgreSQL, MySQL and SQLite?

Changes to quoting identifiers (double quotes for PostgreSQL/SQLite, backticks for MySQL), column type auto-incremental (SERIAL vs AUTO_INCREMENT vs AUTOINCREMENT), and some types like BOOLEAN, which on SQLite is rendered as INTEGER.

What does the batch INSERT do and how can I select it?

Batch size determines how many rows are grouped into a single INSERT statement (for PostgreSQL/SQLite) before starting a new one. Larger batches reduce the number of statements but increase query size: 100-500 rows is a good compromise for large imports.

Can I exclude columns from the CSV or rename them?

Yes. In the column editor, you can deselect a column to exclude it from CREATE TABLE and INSERT, or manually change the SQL type reported if it doesn't match what you need.

Are CSV data files being uploaded to a server?

No, all processing (CSV parsing, type inference, SQL generation) occurs on the client side in the browser: no data is sent to external servers.