1. Learn
  2. /
  3. Courses
  4. /
  5. Functions for Manipulating Data in PostgreSQL

Exercise

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.

Instructions 1/3

undefined XP
  • 1

    Select the title and special features from the film table and compare the results between the two columns.

  • 2

    Select all films that have a special feature Trailers by filtering on the first index of the special_features ARRAY.

  • 3

    Now let's select all films that have Deleted Scenes in the second index of the special_features ARRAY.