CSV to SQL
Turn a CSV file into SQL: a CREATE TABLE statement with column types worked out from the data, and INSERT statements for every row.
Questions
How are column types chosen?
A column where every filled cell is a whole number becomes INTEGER, one with decimals becomes REAL, and everything else is TEXT. Values with a leading zero, such as postcodes and phone numbers, stay TEXT so the zero is kept.
Which databases does the SQL work with?
It uses plain SQL that SQLite, PostgreSQL and MySQL accept for simple tables: lower case names, single quoted text and NULL for blank cells. Adjust the types if your database needs something more specific, such as dates.
How are quotes and blank cells handled?
A single quote inside text is doubled, which is the standard way to escape it. Blank cells become NULL.