XML to DDL - Generate SQL DDL of Oracle, MSSQL, MySQL, DB2 and 20 more from XML

Generate Database Definition Language (DDL) from a XML. A Database Table definition for each complex element of the xml and each simple element and attribute of the complex element defined as Column of the Database Table. The column Type is determined based on the simple element or attribute data if checked. Otherwise every column is defined as VARCHAR (100) except PRIMARY KEY columns.

If any complex element of the root element has ID element or attribute as child then that is referred as a forien key in parent table. Ex: Order as the parent and Customer as the child of Order and CustomerID is part of Order table as forien key. Otherwise child table has parents primary key as forien key, as an example Order as the parent and ShipTo as child.

All repeating child elements will have parent tables primary key as forien key as one of the column. Only first occurance of the repeating element is considered for a Table.

Paste xml in below textarea and click on Generate DDL

Click here to try