Data Structures: JSON and Arrays
Many versions of modern SQL also support data structures, such as JavaScript Object Notation (JSON) and arrays. Arrays are simply lists of data usually written as members enclosed in square brackets. For example, ['cat', 'dog', 'horse']
is an array. A JSON object is a series of key-value pairs that are separated by commas and enclosed in curly braces. For example, {'name': 'Bob', 'age': 27, 'city': 'New York'}
is a valid JSON object. These data structures show up constantly in technology applications, and being able to use them in a database makes it easier to perform many kinds of analysis work.
You will explore data structures in more detail in Chapter 7, Analytics Using Complex Data Types. Before that, you will learn about some basic operations in an RDBMS using SQL.