Inventory
The inventory
database contains the following tables:
The film table
The film
table contains a list of all films (logical information), not necessarily in stock. The stock information (physical copy) is in the table inventory described as follows:
Column |
Description |
---|---|
|
A primary key used to uniquely identify each film in the table. |
|
The title of the film. |
|
A short description or plot summary of the film. |
|
The year the film was released. |
|
A foreign key pointing at the language table; it is used to identify the language of the film. |
|
A foreign key pointing at the language table; it is used to identify the original language of the film. It is only used when a film has been dubbed into a new language. |
|
The number of rental days. |
|
The cost to rent the film for the period specified in the |
|
The length of the film in minutes. |
|
The amount due by a customer if the film has not been returned or if it is damaged. |
|
The rating assigned to the film. The possible values are G, PG, PG-13, R, or NC-17. |
|
The lists in which common special features are included on the DVD. These features can be either |
|
The most recent row update. It has not been used in this book. |
An example of the film
table is shown in the following screenshot:
The category table
The category
table contains a list of all the categories that can be assigned to a film. More than one category can be assigned to a film. A many-to-many relationship is performed by the film_category
table. The columns and values of the category
table are as follows:
Column |
Description |
---|---|
|
A primary key used to uniquely identify each category in the table. |
|
The name of the category. |
|
The most recent row update. It has not been used in this book. |
The following screenshot shows the category
table:
The film_category table
The film_category
table described as follows is used to support a many-to-many relationship between films and categories:
Column |
Description |
---|---|
|
A foreign key identifying the film. |
|
A foreign key identifying the category. |
|
The most recent row update. It has not been used in this book. |
The following screenshot shows the film_category
table:
The language table
The language
table contains columns that may be used to identify the language ID and the original language of the film, described as follows:
Column |
Description |
---|---|
|
A primary key used to uniquely identify each language in the table. |
|
The English name of the language. |
|
The most recent row update. It has not been used in this book. |
The following screenshot shows the language
table:
The actor table
The actor
table contains information about all the actors in the films. More than one actor can be assigned to a film. A many-to-many relationship is performed by the film_actor
table described as follows:
Column |
Description |
---|---|
|
A primary key used to uniquely identify each actor in the table. |
|
The actor's first name. |
|
The actor's last name. |
|
The most recent row update. It has not been used in this book. |
The following screenshot shows the actor
table:
The film_actor table
The film_actor
table is used to support a many-to-many relationship between films and actors described as follows:
Column |
Description |
---|---|
|
A foreign key identifying the film. |
|
A foreign key identifying the actor. |
|
The most recent row update. It has not been used in this book. |
The following screenshot shows the film_actor
table:
The inventory table
Each row in the inventory
table represents a physical copy of a film in a store, described as follows:
Column |
Description |
---|---|
|
A primary key used to uniquely identify each item in the table. |
|
A foreign key identifying the film. |
|
A foreign key identifying the store that the physical copy of a film is in. |
|
The most recent row update. It has not been used in this book. |
The following screenshot shows the inventory
table:
The film_text table
The film_text
table provides a detailed description of the films. This table is a summary of the film
table. It is read only, as described:
Column |
Description |
---|---|
|
A primary key used to uniquely identify each film summary in the table. |
|
The title of the film. |
|
A short description or plot summary of the film. |
The following screenshot shows the film_text
table: