课程: Intermediate SQL for Data Scientists

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Inserting JSON data

Inserting JSON data

- [Instructor] Okay, so we talked about JSON and the advantages of using JSON inside of relational databases. And we briefly discussed some differences between the JSON data type and JSONB data type. So next let's just get a feel for what it's like to work with JSON. So I've opened up code spaces and what I want to do here is I'm going to create a really just dead simple table in the data site schema called API responses. And it's going to have a primary key called the ID, which will just be an integer. And then we're going to have a column called response. And response is going to be a data type JSON. Now remember, JSON is the data type we use when we want like exactly the literal string that we get, we want to store with minimal processing. So that's what we're going to use cuz now we're using an example of an API response. So the most important thing is that we kind of capture exactly what the API response is, so we're going to use JSON. So let's go ahead and run this create table…

内容