Practice: Advanced Data Types · PostgreSQL
Ch 2 · PostgreSQL Data Types — card 3 of 4.
Practise PostgreSQL's special types by building a small table of your own with a tags array and a JSONB metadata column. You will insert a few records, then query them by an array element and by a JSON field. A correct answer uses ANY to search the array and picks the right arrow operator depending on whether you want JSON or text back.
- Create a table with array and JSONB columns
- Insert data with arrays and JSON
- Query using array and JSON operators
-- Create table with tags array and metadata JSONB -- Insert records -- Query by array element and JSON field