The category table
This article introduces the structure of the category table in the Sakila database.
The category table lists the categories that can be assigned to films.
The category table is joined to the film table. The relationship between category and film table is in the film_category table. There is a many-to-many relationship between categories and films.
Table Structure
The structure of the category table is as follows:
+-------------+------------------+------+-----+-------------------+-----------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+-------------------+-----------------------------------------------+
| category_id | tinyint unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(25) | NO | | NULL | |
| last_update | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+-------------+------------------+------+-----+-------------------+-----------------------------------------------+
Table Columns
The following table explains all columns in the category table.
| Column | Description |
|---|---|
category_id |
The surrogate primary key used to uniquely identify each category in the table. |
name |
The name of the category. |
last_update |
The time when the row was created or last updated. |