EN
MySQL - Create table with JSON field
0 points
In this article, we would like to show you how to create table with JSON
field in MySQL.
Quick solution:
xxxxxxxxxx
1
CREATE TABLE `table_name` (
2
`column_name` JSON
3
);
In this example, we create objects
table with id
and json
column which will be JSON
type.
Query:
xxxxxxxxxx
1
CREATE TABLE `objects` (
2
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
3
`json` JSON,
4
PRIMARY KEY (`id`)
5
);
after we insert some values, we get the following result:

Note:
Go to this article to see how to insert
JSON
type values to the table.