EasyEnv
PostgreSQL
IntermediateLesson 11 of 1435 min · hands-on

JSONB and Arrays

Part of the PostgreSQL course

Some data refuses to sit still in columns. A products table where laptops have a RAM size, keyboards have a switch type and monitors have a diagonal, and next month somebody adds candles. You can add a column per attribute and watch the table grow ninety mostly-null columns, or you can invent a key-value side table and hand-roll a query language for it.

The same problem shows up smaller with lists. A post has tags. Three of them, usually. A whole join table for that is often more machinery than the problem deserves, and Postgres will happily let a column hold an array. ...

Want to learn PostgreSQL JSONB and Arrays in a real environment?

Click below, get a fresh Linux box with PostgreSQL ready to go, and work through JSONB and Arrays hands-on with an AI tutor that knows your code.

Start this lessonJSONB and Arrays

What you'll learn

  • JSONB column
  • -> operator
  • ->> operator
  • @> contains operator
  • GIN index on jsonb
  • Text[] and integer[] arrays
  • ANY()
  • Unnest

Read this lesson in your language

All lessons in this course

14 lessons
  1. 1What is PostgreSQL20 min
  2. 2psql and First Commands25 min
  3. 3Creating Databases and Tables30 min
  4. 4Data Types25 min
  5. 5SELECT and WHERE30 min
  6. 6Joins35 min
  7. 7Aggregates and Grouping30 min
  8. 8Indexes35 min
  9. 9Transactions and Isolation35 min
  10. 10Functions and Triggers35 min
  11. 11JSONB and Arrays35 min
  12. 12EXPLAIN and Query Tuning35 min
  13. 13Backup and Restore25 min
  14. 14Capstone: Design a Schema60 min

Explore other courses

JSONB and Arrays - PostgreSQL (English) | Engineering Courses