Sakila Sample Database  /  Known Issues

7 Known Issues

The design of the Sakila sample database assumes that a staff member of a given store rents inventory items to customers only from that store, not from other stores. This assumption is manifest in that the rental, inventory, staff, and store tables have relationships that form a loop. A customer can have only a single store, but a staff member is not similarly constrained. Were a staff member to rent items from other stores, data in the rental table could become inconsistent.

The solution to this issue is left to the reader. Here are some possible approaches:

  • Add a store_id column to the rental table and have foreign keys in the table also reference that column to ensure that not only customer_id and inventory_id but also staff_id in the inventory table have the same store.

  • Add INSERT and UPDATE triggers on the rental table.