Back to home

SQL Generator

Turn CSV into CREATE TABLE and INSERT statements

Rows per batch
Table data
3 × 6
SQL
CREATE TABLE `users` (
  `id` INTEGER,
  `name` VARCHAR(255),
  `email` VARCHAR(255),
  `age` INTEGER,
  `active` TINYINT(1),
  `signup` DATETIME
);

INSERT INTO `users` (`id`, `name`, `email`, `age`, `active`, `signup`) VALUES
  (1, 'Alice Chen', 'alice@example.com', 29, 1, '2024-01-12');

INSERT INTO `users` (`id`, `name`, `email`, `age`, `active`, `signup`) VALUES
  (2, 'Bob Li', 'bob@example.com', 34, 0, '2024-02-03');

INSERT INTO `users` (`id`, `name`, `email`, `age`, `active`, `signup`) VALUES
  (3, 'Carol Wu', 'carol@example.com', 27, 1, '2024-03-21');
3 rows

Column names come from the first row and types are inferred from each column (integer / decimal / date / boolean / text); empty cells become NULL and quotes are escaped. This only writes SQL text and never connects to a database.