Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
2. category table
Resolve tasks

Instruction

First, let's get to know our database. It's named garden and has four tables: category, color, flower, and flower_color.

The first table, category, stores details about the categories of plants sold in the garden store. The store is owned by John, a friend of theirs.

Exercise

The category table shows hierarchical information about plants. It contains these columns:

  • id – The unique ID of the category.
  • name – The name of the category.
  • parent_id - The ID of the parent category, if any, for this category.

The main categories have a NULL value because they don't have any parent category. For example, a pine tree could have the category 'coniferous trees' and 'coniferous trees' could have the parent category 'tree'. The 'tree' category wouldn't have a parent category; it would have a NULL value in this column.

Explore the contents of the table category by selecting all the data from it.