JSON Manipulation With SQL — With Code Snippet & Walk-Through

Maxime Godfroid
The Startup
Published in
5 min readJul 8, 2020

--

Source: jquery script.net

Introduction

This article will focus on JSON, what it is, how and when it is most commonly used. It will also outlay the first steps to parse JSON data using SQL. And a BONUS: how to pronounce it 😁

Definition & JSON structure

First of all, a short definition from json.org:

“JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd Edition (…)”

JSON is made of two main structures:

  • JSON Object, this is a collection of key-value pairs. It is recognizable by its curly brackets {}. It begins with { and ends with }.
  • JSON Array, sometimes called list or sequence. It is recognizable by its square brackets []. It begins with [ and ends with ].

As JSON data gets more complex, you might encounter nested objects and nested arrays, but the fundamentals remain the same.

How does JSON data look like?

An example of a raw JSON focusing on Nobel Prizes can be found here.

--

--

Maxime Godfroid
The Startup

Data Scientist Lead | Runner by day | Podcaster by night | Also a tech & sports enthusiast | Subscribe to get all my stories | Twitter @max_godfroid