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

film_id

A primary key used to uniquely identify each film in the table.

title

The title of the film.

description

A short description or plot summary of the film.

release_year

The year the film was released.

language_id

A foreign key pointing at the language table; it is used to identify the language of the film.

original_language_id

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.

rental_duration

The number of rental days.

rental_rate

The cost to rent the film for the period specified in the rental_duration column.

length

The length of the film in minutes.

replacement_cost

The amount due by a customer if the film has not been returned or if it is damaged.

rating

The rating assigned to the film. The possible values are G, PG, PG-13, R, or NC-17.

special_features

The lists in which common special features are included on the DVD. These features can be either Trailers, Commentaries, Deleted Scenes, Behind the Scenes, or nothing at all.

last_update

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 film table

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

category_id

A primary key used to uniquely identify each category in the table.

category

The name of the category.

last_update

The most recent row update. It has not been used in this book.

The following screenshot shows the category table:

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

film_id

A foreign key identifying the film.

category_id

A foreign key identifying the category.

last_update

The most recent row update. It has not been used in this book.

The following screenshot shows the film_category table:

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

language_id

A primary key used to uniquely identify each language in the table.

language

The English name of the language.

last_update

The most recent row update. It has not been used in this book.

The following screenshot shows the language table:

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

actor_id

A primary key used to uniquely identify each actor in the table.

first_name

The actor's first name.

last_name

The actor's last name.

last_update

The most recent row update. It has not been used in this book.

The following screenshot shows the actor table:

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

film_id

A foreign key identifying the film.

actor_id

A foreign key identifying the actor.

last_update

The most recent row update. It has not been used in this book.

The following screenshot shows the film_actor table:

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

inventory_id

A primary key used to uniquely identify each item in the table.

film_id

A foreign key identifying the film.

store_id

A foreign key identifying the store that the physical copy of a film is in.

last_update

The most recent row update. It has not been used in this book.

The following screenshot shows the inventory table:

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

film_id

A primary key used to uniquely identify each film summary in the table.

title

The title of the film.

description

A short description or plot summary of the film.

The following screenshot shows the film_text table:

The film_text table
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset