Session Ready
Exercise

Joining themes to their children

Tables can be joined to themselves!

In the themes table, which is available for you to inspect in the console, you'll notice there is both an id column and a parent_id column. Keeping that in mind, you can join the themes table to itself to determine the parent-child relationships that exist for different themes.

In the videos, you saw themes joined to their own parents. In this exercise, you'll try a similar approach of joining themes to their own children, which is similar but reversed. Let's try this out to discover what children the theme "Harry Potter" has.

Instructions
100 XP
  • Inner join themes to their own children, resulting in the suffixes "_parent" and "_child", respectively.
  • Filter this table to find the children of the "Harry Potter" theme.