The film_category table

This article introduces the structure of the film_category table in the Sakila database.

The film_category table is used to support many-to-many relationships between films and categories. For each category applied to the film, there is a row in the film_category table.

The film_category table refers to the film and category tables using foreign keys.

Table Structure

The structure of the film_category table is as follows:

+-------------+-------------------+------+-----+-------------------+-----------------------------------------------+
| Field       | Type              | Null | Key | Default           | Extra                                         |
+-------------+-------------------+------+-----+-------------------+-----------------------------------------------+
| film_id     | smallint unsigned | NO   | PRI | NULL              |                                               |
| category_id | tinyint unsigned  | NO   | PRI | NULL              |                                               |
| last_update | timestamp         | NO   |     | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+-------------+-------------------+------+-----+-------------------+-----------------------------------------------+

Table Columns

The following table explains all columns in the film_category table.

Column Description
film_id The foreign key that identifies the film.
category_id The foreign key that identifies the category.
last_update The time when the row was created or last updated.