EN
My tools

CSV to SQL Converter (CREATE TABLE + INSERT)

Convert CSV to SQL: CREATE TABLE with inferred column types and batched INSERT or upsert statements for MySQL, PostgreSQL, SQLite, SQL Server and Oracle.

schema.table is allowed; names are quoted for the dialect.
When set, rows are inserted or updated (ON CONFLICT, ON DUPLICATE KEY or MERGE).
Otherwise empty text cells become '' (empty cells in number and date columns are always NULL).
My tools →
Advertisement

Loading a spreadsheet into a database usually means writing a CREATE TABLE by hand and then hundreds of INSERT lines. Paste the CSV (or cells copied from Excel) and get both: column types are inferred from the data — whole numbers, decimals with the right precision, booleans, dates and text with a fitting length — and the rows are written as batched multi-row INSERTs, or as upserts if you name a key column. Identifiers, strings, booleans and dates are written the way MySQL, PostgreSQL, SQLite, SQL Server or Oracle expect.

How to use this tool

  1. Paste CSV data with the column names in the first row.
  2. Enter the table name and choose your database.
  3. Choose whether to include CREATE TABLE and DROP TABLE IF EXISTS.
  4. Optionally name a key column to get upsert statements instead of plain INSERTs.
  5. Copy the SQL and run it in your database client.

Formula

INSERT INTO table (col, …) VALUES (row 1), (row 2), …; — one statement per batch of rows

Types: whole numbers → INTEGER (BIGINT beyond ±2,147,483,647), decimals → DECIMAL(p,s) with p = integer digits + s decimals, true/false → BOOLEAN (BIT in SQL Server, NUMBER(1) in Oracle, 1/0 in SQLite), YYYY-MM-DD → DATE, with a time → TIMESTAMP/DATETIME, anything else → VARCHAR(longest value) or TEXT. Values with a leading zero such as 02134 stay text. Single quotes are doubled; MySQL also doubles backslashes. Upserts use ON CONFLICT (PostgreSQL, SQLite), ON DUPLICATE KEY UPDATE (MySQL) or MERGE (SQL Server, Oracle).

Example

The sample products become CREATE TABLE "products" with id INTEGER, name VARCHAR(13), email VARCHAR(18), price NUMERIC(4,2) (4.50, 1.20 and 12), in_stock BOOLEAN and added DATE, followed by one INSERT with 3 rows: (3, 'O''Brien''s Ink', 'ink@example.com', 12, FALSE, NULL) shows the doubled quotes and the empty date as NULL. The empty email of row 2 also becomes NULL.

Frequently asked questions

Why is my numeric column VARCHAR?

At least one cell is not a plain number — a thousands separator, a currency sign, a unit or a leading zero. Clean the column in the spreadsheet or change the type in the generated SQL.

How many rows can I convert?

Up to 200,000 rows in the browser. Statements hold up to 1000 rows each, the limit for one VALUES list in SQL Server.

Is the data safe to run?

Every value is written as a quoted literal or a validated number, so cell contents cannot break out of the statement. Review the SQL before running it on a production database anyway.

Is my file uploaded?

No. The conversion happens in your browser.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). CSV to SQL Converter (CREATE TABLE + INSERT). https://kakao.mobile/tools/csv-to-sql-tool/

MLA

“CSV to SQL Converter (CREATE TABLE + INSERT).” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/csv-to-sql-tool/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement