CSV Header to CREATE TABLE
Generates a CREATE TABLE skeleton from a CSV header row, with cleaned identifier names.
Loading the tool…
How to use this tool
- Paste the first line of your CSV, the header row.
- Set the table name, the dialect and the column type you want to start from.
- Select Generate DDL, then narrow the types before you use it.
What csv header to create table does
Loading a CSV into a database starts with a table to load it into. This takes the header row, converts each name into a safe lower-case identifier, and writes a CREATE TABLE statement quoted for the dialect you choose. Spaces, punctuation and leading digits are dealt with, so "Order Total (AUD)" becomes order_total_aud.
Every column comes out as text on purpose. Guessing a type from a header name is how a phone number becomes an integer and loses its leading zero, and guessing from the first few rows is how a column that is numeric for a thousand rows meets its first "N/A". Load as text if you like, then narrow the types deliberately once you have seen the data.