Online CSV to SQL Insert Query Builder

CSV to SQL Insert Query Builder

Convert CSV data to SQL INSERT statements. The first row should contain column headers.

Input CSV Data

Ensure the first row contains column headers

Table Name

SQL Query:


  

How to Use This Tool

Follow these steps to convert CSV data to SQL INSERT statements:

  1. Paste your CSV data into the input textarea. Ensure the first row contains column headers.
  2. Enter the name of the table you want to insert the data into.
  3. Check the "Create table" box if you want to generate a CREATE TABLE statement.
  4. Click the "Generate SQL Query" button.
  5. View the generated SQL query, including CREATE TABLE if selected.

Example

For the following CSV data:

id,name,city
1,Jimmpy Apples,Paulo Alto
2,Sandy Moran,Chicago
    

And table name "users" with "Provide Create Table Query" checked, the generated SQL query would be:

CREATE TABLE users (
    id VARCHAR(255),
    name VARCHAR(255),
    city VARCHAR(255)
);

INSERT INTO users (id, name, city)
VALUES
('1', 'Jimmy Apples', 'Paulo Alto'),
('2', 'Sandy Moran', 'Chicago');
    

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!