From the course: Advanced SQL for Data Scientists

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

JSON for semi-structured data

JSON for semi-structured data

From the course: Advanced SQL for Data Scientists

Start my 1-month free trial

JSON for semi-structured data

- [Instructor] Now PostgreSQL provides data types for supporting JSON, which is ideal for semi-structured data. So with PostgreSQL, we have options to use both relational and NoSQL type features. Now JSON is particularly good at modeling document databases. Now, document databases are used when a use case demands a flexible schema, nested structures, and the ability to query an index keys throughout the structure. Since PostgreSQL 9.2, we can have both relational and document structures in a single database. So here's an example of a document structure. Let's imagine we have a table called Customer Summary and we have the name of a customer, their address, and then some information about purchase history. Well, each of those could itself be a complex structure. So for example, name could be a pair, first name and last name. Address could be made up of a street, city, province, postal code. And finally, the purchase…

Contents