CSV to SQL Converter
Turn a CSV file into CREATE TABLE and INSERT statements for PostgreSQL, MySQL, SQL Server, Oracle or SQLite. Free, in your browser.
How to use the CSV to SQL Converter
Generate CREATE TABLE and INSERT statements from sample data.
- Load sample data
- Review the column types
- Pick a database and copy
Tips
- Works for PostgreSQL, MySQL, SQL Server, SQLite and Oracle.
- Set a primary key and edit any type the tool guessed.
- Copy and Download contain the full script.
Example
Input: id,name
1,Ada
Output: CREATE TABLE t (id INT, name TEXT);
INSERT INTO t VALUES (1, 'Ada');
Frequently asked questions
How do I convert a CSV to SQL?
Upload the CSV, pick your database and copy the CREATE TABLE and INSERT statements.
Are column types detected?
Yes. Types are guessed from your data, and you can check them before you run the script.
Does it connect to my database?
No. It only writes the SQL for you to run yourself.
Guides