JSON to SQL Query Converter
Convert JSON data to SQL INSERT statements. The JSON should be an array of objects.
SQL Query:
How to Use This Tool
Follow these steps to convert JSON data to SQL INSERT statements:
- Paste your JSON data into the input textarea. Ensure it's an array of objects.
- Enter the name of the table you want to insert the data into.
- Check the "Create table" box if you want to generate a CREATE TABLE statement.
- Click the "Generate SQL Query" button.
- View the generated SQL query, including CREATE TABLE if selected.
Example
For the following JSON data:
[
{"id": 1, "name": "Jimmy Apples", "city": "Paulo Alto"},
{"id": 2, "name": "Sandy Moran", "city": "Chicago"}
]
And table name "users" with "Provide Create Table Query" checked, the generated SQL query would be:
CREATE TABLE users (
id VARCHAR(255),
name VARCHAR(255),
city VARCHAR(255)
);
INSERT INTO users (id, name, city)
VALUES
('1', 'Jimmy Apples', 'Paulo Alto'),
('2', 'Sandy Moran', 'Chicago');
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!