film
Documentation | Sakila |
Name | film |
Module | Inventory |
The film table is a list of all films potentially in stock in the stores. The actual in-stock copies of each film are represented in the inventory table.
The film table refers to the language table and is referred to by the film_category, film_actor, and inventory tables.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | film_id | unsigned smallint(5, 0) | Identity / Auto increment column | A surrogate primary key used to uniquely identify each film in the table. | ||||
A surrogate primary key used to uniquely identify each film in the table. Identity / Auto increment column |
||||||||
2 | title | varchar(255) | The title of the film. | |||||
The title of the film. |
||||||||
3 | description | text | A short description or plot summary of the film. | |||||
A short description or plot summary of the film. |
||||||||
4 | release_year | year | The year in which the movie was released. | |||||
The year in which the movie was released. |
||||||||
5 | language_id | unsigned tinyint(3, 0) | language | A foreign key pointing at the language table; identifies the language of the film. | ||||
A foreign key pointing at the language table; identifies the language of the film. References: language |
||||||||
6 | original_language_id | unsigned tinyint(3, 0) | language | A foreign key pointing at the language table; identifies the original language of the film. Used when a film has been dubbed into a new language. | ||||
A foreign key pointing at the language table; identifies the original language of the film. Used when a film has been dubbed into a new language. References: language |
||||||||
7 | rental_duration | unsigned tinyint(3, 0) | Default: 3 | The length of the rental period, in days. | ||||
The length of the rental period, in days. Default: 3 |
||||||||
8 | rental_rate | decimal(4, 2) | Default: 4.99 | The cost to rent the film for the period specified in the rental_duration column. | ||||
The cost to rent the film for the period specified in the rental_duration column. Default: 4.99 |
||||||||
9 | length | unsigned smallint(5, 0) | The duration of the film, in minutes. | |||||
The duration of the film, in minutes. |
||||||||
10 | replacement_cost | decimal(5, 2) | Default: 19.99 | The amount charged to the customer if the film is not returned or is returned in a damaged state. | ||||
The amount charged to the customer if the film is not returned or is returned in a damaged state. Default: 19.99 |
||||||||
11 | rating | enum | Default: G | The rating assigned to the film. Can be one of: G, PG, PG-13, R, or NC-17. | ||||
The rating assigned to the film. Can be one of: G, PG, PG-13, R, or NC-17. Default: G |
||||||||
12 | special_features | set | Lists which common special features are included on the DVD. Can be zero or more of: Trailers, Commentaries, Deleted Scenes, Behind the Scenes. | |||||
Lists which common special features are included on the DVD. Can be zero or more of: Trailers, Commentaries, Deleted Scenes, Behind the Scenes. |
||||||||
13 | last_update | timestamp | Default: CURRENT_TIMESTAMP | The time that the row was created or most recently updated. | ||||
The time that the row was created or most recently updated. Default: CURRENT_TIMESTAMP |
Relations
Foreign table | Primary table | Join | Title / Name / Description | |
---|---|---|---|---|
film | language | film.language_id = language.language_id | fk_film_language Foreign key constraint referencing language.language_id |
|
film.language_id = language.language_id Name: fk_film_languageForeign key constraint referencing language.language_id |
||||
film | language | film.original_language_id = language.language_id | fk_film_language_original Foreign key constraint referencing language.language_id |
|
film.original_language_id = language.language_id Name: fk_film_language_originalForeign key constraint referencing language.language_id |
||||
film_actor | film | film_actor.film_id = film.film_id | fk_film_actor_film Foreign key constraint referencing film.film_id |
|
film_actor.film_id = film.film_id Name: fk_film_actor_filmForeign key constraint referencing film.film_id |
||||
film_category | film | film_category.film_id = film.film_id | fk_film_category_film Foreign key constraint referencing film.film_id |
|
film_category.film_id = film.film_id Name: fk_film_category_filmForeign key constraint referencing film.film_id |
||||
inventory | film | inventory.film_id = film.film_id | fk_inventory_film Foreign key constraint referencing film.film_id |
|
inventory.film_id = film.film_id Name: fk_inventory_filmForeign key constraint referencing film.film_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PRIMARY | film_id | Primary key. | |
Primary key. |
Triggers
Key name | When | Description | |
---|---|---|---|
del_film | After Delete | The del_film trigger duplicates all DELETE operations on the film table to the film_text table. | |
The del_film trigger duplicates all DELETE operations on the film table to the film_text table. | |||
ins_film | After Insert | The ins_film trigger duplicates all INSERT operations on the film table to the film_text table. | |
The ins_film trigger duplicates all INSERT operations on the film table to the film_text table. | |||
upd_film | After Update | The upd_film trigger duplicates all UPDATE operations on the film table to the film_text table. | |
The upd_film trigger duplicates all UPDATE operations on the film table to the film_text table. |
Used by
Name |
---|
film
|
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44