Appendix A. Sakila DB Data Dictionary

In this section, we will show each table's data dictionary as well as a small sample of the data. We will divide the database model into three subdiagrams:

  • Customer data
  • Inventory
  • Business

The Customer data database contains following tables.

The customer table

The customer table contains information about all customers described as follows:

Column

Description

customer_id

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

store_id

A foreign key identifying the customer's "home store". Customers are not limited to renting only from this store, but this is the store they generally shop at.

first_name

The customer's first name.

last_name

The customer's last name.

email

The customer's e-mail address.

address_id

A foreign key identifying the customer's address in the address table.

active

Indicates if the customer is an active customer. Setting this to FALSE serves as a logical deletion of the customer.

create_date

The date when the customer was added to the database.

last_update

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

This information of all the customers is shown in a pictorial format in the following screenshot:

The customer table

The address table

The address table contains the address information of customers, staff, and stores described as follows:

Column

Description

address_id

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

address

A line of address information.

address2

Another line of address information that is used if the first line is not enough.

district

The region of an address; this may be a state, province, prefecture, and so on.

city_id

A foreign key identifying the city of the address in the city table.

postal_code

The postal code or zip code of the address.

phone

The phone number for the address.

last_update

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

An example of the address table is shown in the following screenshot:

The address table

The city table

The city table contains a list of cities described as follows:

Column

Description

city_id

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

city

The name of the city.

country_id

A foreign key identifying the country the city belongs to in the country table.

last_update

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

An example of the city table is shown in the following screenshot:

The city table

The country table

The country table contains a list of countries described as follows:

Column

Description

country_id

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

country

The name of the country.

last_update

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

An example of the country table is shown in the following screenshot:

The country table
..................Content has been hidden....................

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