JavaScript Object Notation (JSON) is a lightweight programming independent data interchange format. It is mainly used in web applications to transmit information. It is not only simple for humans to read but easy for machines to parse and generate. JSON has some advantages for traditional extensible markup language (XML):
- XML data is a typeless only string, whereas JSON data is typed like string, number, array, and boolean
- JSON data is readily accessible, whereas XML data needs to be parsed and assigned to variables
The JSON syntax is a subset of the JavaScript syntax. There are some rules when it comes to JSON syntax:
- Data is defined in name/value pairs
- Data is separated by commas
- Curly braces hold objects
- Square brackets hold arrays
{
"name":"Robert"
}
We can use JSON as we would use any other SQL data type:
- JSON content...