Accessing data in an ARRAY
In our DVD Rentals database, the film table contains an ARRAY for special_features
which has a type of TEXT[]
. Much like any ARRAY
data type in PostgreSQL, a TEXT[]
array can store an array of TEXT
values. This comes in handy when you want to store things like phone numbers or email addresses as we saw in the lesson.
Let's take a look at the special_features
column and also practice accessing data in the ARRAY.
This exercise is part of the course
Functions for Manipulating Data in PostgreSQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Select the title and special features column
SELECT
___,
___
FROM film;