课程: Intermediate SQL for Data Scientists
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Indexing JSON data
- [Instructor] Now let's take a look at working with indexes and JSON data structures. So the first thing I want to do is I want to delete the API responses table and I want to recreate it, but this time I want to use the data type JSONB for the response column, which of course, is where we're going to be storing our JSON structure. So I'll go ahead and run that. And so now we have dropped that table, so I'm going to erase that. And now I'm just going to paste in an insert statement and we'll go ahead and insert that. And so this is the same insert statement I had used before, and we see we have successfully inserted that. So that's basically all the same up to this point. Now what I want to do is I want to show you how to create an index. And I'll just, again, paste in the create index statement here. Now, what this statement does, it follows this typical pattern for create index. We specify an index name and then the on term followed by the name of the table. In this case, it's data…