The JSON data type in Oxla has the following syntax:
First, create the orders table using the below command:
This will create a table with the orders_Detailcolumn to store key-value pairs of data.
Next, insert data into the orders table as follows:
This will insert data values where orders_Detailhas the following keys:
- customer: it will store a customer’s data who purchased the product.
- items: it will store the order details, product & qty.
Use the SELECT command to retrieve the orders table's data.
You will get the following output:
Note: It is normal for the JSON type’s result to look disordered.