5.1.6 The customer Table

The customer table contains a list of all customers.

The customer table is referred to in the payment and rental tables and refers to the address and store tables using foreign keys.

  • customer_id: A surrogate primary key used to uniquely identify each customer in the table.

  • store_id: A foreign key identifying the customer home store. Customers are not limited to renting only from this store, but this is the store at which they generally shop.

  • first_name: The customer first name.

  • last_name: The customer last name.

  • email: The customer email address.

  • address_id: A foreign key identifying the customer address in the address table.

  • active: Indicates whether the customer is an active customer. Setting this to FALSE serves as an alternative to deleting a customer outright. Most queries should have a WHERE active = TRUE clause.

  • create_date: The date the customer was added to the system. This date is automatically set using a trigger during an INSERT.

  • last_update: When the row was created or most recently updated.