Working with lists
In this section, we’re going to dive a bit deeper into working with the LIST
data type, which we introduced earlier in this chapter. DuckDB provides a range of features and affordances that make this a particularly powerful and flexible data type, some of which take inspiration from other languages, such as Python. Before we dive into playing with LIST
types, we’ll prepare some data that we’ll use for this section, and which we’ll also use later in this chapter.
Preparing the data
The data we’ll be using consists of a small dataset of films, leading actors, and roles they play and is located in the film_actors.csv
CSV file in this chapter’s directory in this book’s GitHub repository. We’ll create a table called film_actors
, which we’ll import the contents of the CSV file into:
CREATE OR REPLACE TABLE film_actors AS SELECT * FROM read_csv('film_actors.csv');
Let’s have a look...