๐Ÿ“„ XML to SQL

Convert XML to SQL CREATE TABLE and INSERT statements

Input

๐Ÿ’ก Paste an XML document below. Repeated elements become child tables; single child elements are flattened into 1:1 columns; attributes and text become fields. Types are detected automatically.
All processing happens locally in your browser โ€” no data is sent anywhere.
๐Ÿ“Œ An id attribute/element becomes the PRIMARY KEY (no autoincrement), like in the JSON tool.
๐Ÿ“Œ Schema: PostgreSQL uses a schema, MySQL uses a database, SQLite has no schema.
โš ๏ธ Generated code is provided "as is". Always verify generated SQL before running on production databases. Read our Terms of Service.
Treat every element with this name as one record. Useful when records are not a single repeated group at the root.
You can either upload a file or paste XML directly above.

SQL Result

โœ… Generated SQL code appears here