Convert JSON to SQL

Form for JSON converting to SQL

This form allows you convert JSON to SQL queries, paste or upload your JSON file below:


SQL configuration:

Your result can be seen below.

Result of JSON conversion to SQL


Move to "Paste Code" for Save it

About JSON conversion to SQL

About JSON data conversion to SQL queries

The JSON to SQL Converter was created for online transform JSON(JavaScript Object Notation) data into SQL(Structured Query Language) queries to insert in the database. This awesome tool supports custom table name and several MySQL commands to insert.

As a result, you will receive several queries:

  • SQL query to create a table. But this is just an example of "create table"; in fact, it is not recommended to execute this query, because it does not contain indexes, keys, valid types, etc.
  • Insert or Replace queries.

How it Works?

Just select the options you need and paste your JSON data to the textarea above and click to the button "Convert" and you will instantly get SQL queries.

Example of JSON conversion to SQL

Before:
{
	"root":
	{
		"rows": [
		{
			"LatD": "41",
			"LatM": "5",
			"LatS": "59",
			"NS": "N",
			"LonD": "80",
			"LonM": "39",
			"LonS": "0",
			"EW": "W",
			"City": "Youngstown",
			"State": "OH"
		},
		{
			"LatD": "42",
			"LatM": "52",
			"LatS": "48",
			"NS": "N",
			"LonD": "97",
			"LonM": "23",
			"LonS": "23",
			"EW": "W",
			"City": "Yankton",
			"State": "SD"
		},
		{
			"LatD": "46",
			"LatM": "35",
			"LatS": "59",
			"NS": "N",
			"LonD": "120",
			"LonM": "30",
			"LonS": "36",
			"EW": "W",
			"City": "Yakima",
			"State": "WA"
		},
		{
			"LatD": "42",
			"LatM": "16",
			"LatS": "12",
			"NS": "N",
			"LonD": "71",
			"LonM": "48",
			"LonS": "0",
			"EW": "W",
			"City": "Worcester",
			"State": "MA"
		},
		{
			"LatD": "43",
			"LatM": "37",
			"LatS": "48",
			"NS": "N",
			"LonD": "89",
			"LonM": "46",
			"LonS": "11",
			"EW": "W",
			"City": "Wisconsin Dells",
			"State": "WI"
		}]
	}
}
After:
/* CREATE TABLE */
CREATE TABLE table_name(
`LatD` DOUBLE,
`LatM` DOUBLE,
`LatS` DOUBLE,
`NS` VARCHAR(100),
`LonD` DOUBLE,
`LonM` DOUBLE,
`LonS` DOUBLE,
`EW` VARCHAR(100),
`City` VARCHAR(100),
`State` VARCHAR(100)
);

/* INSERT QUERY NO: 1 */
INSERT INTO table_name(`LatD`, `LatM`, `LatS`, `NS`, `LonD`, `LonM`, `LonS`, `EW`, `City`, `State`)
VALUES (41, 5, 59, 'N', 80, 39, 0, 'W', 'Youngstown', 'OH');

/* INSERT QUERY NO: 2 */
INSERT INTO table_name(`LatD`, `LatM`, `LatS`, `NS`, `LonD`, `LonM`, `LonS`, `EW`, `City`, `State`)
VALUES (42, 52, 48, 'N', 97, 23, 23, 'W', 'Yankton', 'SD');

/* INSERT QUERY NO: 3 */
INSERT INTO table_name(`LatD`, `LatM`, `LatS`, `NS`, `LonD`, `LonM`, `LonS`, `EW`, `City`, `State`)
VALUES (46, 35, 59, 'N', 120, 30, 36, 'W', 'Yakima', 'WA');

/* INSERT QUERY NO: 4 */
INSERT INTO table_name(`LatD`, `LatM`, `LatS`, `NS`, `LonD`, `LonM`, `LonS`, `EW`, `City`, `State`)
VALUES (42, 16, 12, 'N', 71, 48, 0, 'W', 'Worcester', 'MA');

/* INSERT QUERY NO: 5 */
INSERT INTO table_name(`LatD`, `LatM`, `LatS`, `NS`, `LonD`, `LonM`, `LonS`, `EW`, `City`, `State`)
VALUES (43, 37, 48, 'N', 89, 46, 11, 'W', 'Wisconsin Dells', 'WI');
After conversion, you can execute these commands in your SQL server and add all data to your database.