Business

The business database contains the following tables:

The staff table

The staff table contains information about all staff members described as follows:

Column

Description

staff_id

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

first_name

The staff member's first name.

last_name

The staff member's last name.

address_id

A foreign key identifying the address of the staff member in the address table.

picture

A photograph of the employee.

email

The staff member's e-mail address.

store_id

The staff member's "home store". The employee can work at other stores but is generally assigned to the store that is listed.

active

Indicates whether the staff member is an active staff member. Setting this to FALSE serves as a logical deletion of the staff member.

username

The username used by the staff member to access the rental system.

password

The password used by the staff member to access the rental system.

last_update

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

The following screenshot shows the table_staff table:

The staff table

The store table

The store table contains information about all the stores described as follows:

Column

Description

store_id

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

manager_staff_id

A foreign key identifying the manager of this store in the staff table.

address_id

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

last_update

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

The following screenshot shows the store table:

The store table

The rental table

The rental table contains information about each rental of each inventory item described as follows:

Column

Description

rental_id

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

rental_date

The date and time at which the item was rented.

inventory_id

A foreign key identifying the physical film being rented in the inventory table.

customer_id

The customer who rents the film.

return_date

The date and time at which the film was returned.

staff_id

The staff member who processed the rental.

last_update

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

The following screenshot shows the rental table:

The rental table

The payment table

The payment table contains information about each payment made by a customer, with information such as the amount and the rental being paid for (when applicable), described as follows:

Column

Description

payment_id

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

customer_id

A foreign key that identifies the customer making the payment in the customer table.

staff_id

A foreign key that identifies the staff member who processed the payment in the staff table.

rental_id

The rental that the payment is being applied to. This is optional because some payments are for outstanding fees and may not be directly related to a rental.

amount

The amount of the payment.

payment_date

The date on which the payment was processed.

last_update

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

The following screenshot shows the payment table:

The payment table
..................Content has been hidden....................

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