mariadbWorking with JSON in Mariadb
JSON is a popular data format for storing and exchanging data. MariaDB supports JSON data types, allowing you to store and manipulate JSON documents in MariaDB.
Example code
CREATE TABLE json_table (
id INT NOT NULL AUTO_INCREMENT,
json_data JSON,
PRIMARY KEY (id)
);
Output example
Query OK, 0 rows affected (0.02 sec)
Code explanation
CREATE TABLE: This statement creates a new table in the database.json_table: This is the name of the table being created.id INT NOT NULL AUTO_INCREMENT: This creates a column calledidwith an integer data type that is not null and automatically increments.json_data JSON: This creates a column calledjson_datawith a JSON data type.PRIMARY KEY (id): This sets theidcolumn as the primary key for the table.
Helpful links
More of Mariadb
- How to get current year in Mariadb?
- How to get yesterday's date in Mariadb?
- How to check version of Mariadb?
- What type to use for a year in Mariadb?
- How to change wait_timeout in Mariadb?
- How to use window functions in Mariadb?
- How to use the WITH clause in Mariadb?
- How to list users in Mariadb?
- How to work with XML in Mariadb?
- How to use variables in Mariadb?
See more codes...