Data Converter CSV to SQL
Convert CSV and TSV files into CREATE TABLE and INSERT INTO SQL statements with automatic data type inference 100% in your browser.
Column Data Types Adjustment
id
id
nombre_producto
nombre_producto
categoria
categoria
precio
precio
stock
stock
en_oferta
en_oferta
fecha_ingreso
fecha_ingreso
The engine parses every column value across all rows using optimized regular expressions, discovering integers (INTEGER / BIGINT), floating point numbers (DECIMAL), booleans (true/false/1/0), ISO 8601 dates (YYYY-MM-DD), timestamps, and text.
Each SQL dialect requires distinct native data types: PostgreSQL outputs TIMESTAMPTZ and BOOLEAN; MySQL emits DATETIME and TINYINT(1); SQL Server maps to DATETIME2 and BIT; SQLite uses dynamic INTEGER and TEXT; Oracle relies on NUMBER and TIMESTAMP.
Executing thousands of individual INSERT statements overwhelms network connections and WAL logs. Grouping rows into chunks of 50 or 100 records per INSERT statement accelerates ingestion by up to 900% while staying within safe payload thresholds.
The parser automatically detects whether your file utilizes commas (,), semicolons (;), tabs (\t), or pipes (|). It gracefully handles multiline fields and escaped nested double quotes ("""), sanitizing column headers into valid SQL identifiers.
1. Commas or Line Breaks in Text Misalign Columns
CSV rows split incorrectly into more columns than defined in the header.
Wrap any text cell containing commas or line breaks in double quotes "my text, with comma".
RFC 4180 dictates that fields containing delimiters or line breaks (CRLF) must be enclosed in double quotes. Quotes within quoted fields must be escaped by doubling them (e.g. "Monitor 27"" 144Hz").
2. Error: 'Packet Too Large' or Max Variable Limit Exceeded
The SQL server rejects the generated script due to maximum query packet size or variable limits.
Switch the 'Batch Insert Chunk' selector to 'Chunks of 50 rows' or 'Chunks of 100 rows' before downloading the .sql file.
MySQL enforces max_allowed_packet limits on single statements. SQLite and PostgreSQL have parameter limits on prepared queries (32,766 in SQLite). Chunking by 50-100 rows avoids packet exhaustion.
3. Dates in DD/MM/YYYY Format Inferred as VARCHAR / TEXT
Date columns are not detected as native DATE types in the CREATE TABLE statement.
Use the 'Customize Column Types' panel below to switch the column type to 'DATE', or reformat CSV dates to ISO YYYY-MM-DD.
Regional date formats (DD/MM/YYYY vs MM/DD/YYYY) are inherently ambiguous. To maintain data integrity, SQL engines standardize on ISO 8601 (YYYY-MM-DD).
4. Headers with Spaces, Accents or Special Characters
Column header names cause syntax errors in the database CREATE TABLE statement.
The tool automatically sanitizes header names into snake_case identifiers (e.g. 'Total Price ($)' → 'total_price'). You can fine-tune names if needed.
Valid SQL identifiers cannot contain unquoted spaces, hyphens, or non-alphanumeric characters without engine-specific quote delimiters.
The Oldest File Format Still in Daily Use
The CSV format debuted in 1972 on IBM OS/360 Fortran systems to exchange data records across mainframes. Despite the arrival of JSON, XML, YAML, and Protocol Buffers, CSV remains the universal standard for database exports and data science pipelines.
Why Excel Exports with Semicolons (;) in Spanish?
In Spanish-speaking countries and most of continental Europe, the comma (,) is the standard decimal separator (e.g. 19,99 €). To prevent floating point numbers from splitting into separate columns, Excel automatically adopts the semicolon (;) as the list delimiter.
PostgreSQL COPY vs Bulk INSERT
For small and medium datasets, multi-row INSERT INTO VALUES (...) is the most portable and transactional approach. For millions of rows in production, PostgreSQL's binary COPY FROM STDIN bypasses SQL query planning overhead, ingesting up to 100,000 rows per second.
RFC 4180: A Standard That Arrived 33 Years Late
Although billions of CSV files were shared across the internet since the 1970s, the IETF did not publish a formal specification until 2005 (RFC 4180). Even today, it remains categorized as an 'Informational Memo' rather than a strict rigid internet standard.