SQL Query GeneratorDeveloper Tools
Generates CREATE, INSERT, SELECT, UPDATE, and DELETE statements for four databases.
This CSV to SQL converter turns a spreadsheet export into INSERT statements you can run on your database. It guesses column types, writes a CREATE TABLE, and quotes values correctly for MySQL, PostgreSQL, SQLite, or SQL Server.
The CSV is read by the RFC 4180 rules, so quoted values can contain commas, quotes (written as ""), and line breaks. Each column's type is inferred from all its values:
Text is quoted with single quotes, and single quotes inside values are doubled. Identifiers use the quoting of each database: `backticks` for MySQL, "double quotes" for PostgreSQL and SQLite, [brackets] for SQL Server.
id,name / 1,O'Neil → INSERT INTO `my_table` (`id`, `name`) VALUES (1, 'O''Neil');For a few thousand rows, INSERT statements are fine. For hundreds of thousands, use the database's bulk loader instead: LOAD DATA INFILE in MySQL, COPY in PostgreSQL, .import in SQLite, or BULK INSERT in SQL Server. They are much faster and read the CSV directly.
Paste or upload the CSV, choose your database and table name, and copy the generated CREATE TABLE and INSERT statements.
Yes. A single quote inside a value is doubled (O''Neil), which is the standard SQL escape.
No. The conversion runs in your browser; the SQL is only text you copy or download.
Often used together with the CSV to SQL Converter.
Generates CREATE, INSERT, SELECT, UPDATE, and DELETE statements for four databases.
Formats SQL queries for MySQL, PostgreSQL, SQLite, SQL Server, and more.
Turns a CSV table into an array of JSON objects.