store
Documentation | Sakila |
Name | store |
Module | Business |
The store table lists all stores in the system. All inventory is assigned to specific stores, and staff and customers are assigned a “home store”.
The store table refers to the staff and address tables using foreign keys and is referred to by the staff, customer, and inventory tables.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | store_id | unsigned tinyint(3, 0) | Identity / Auto increment column | A surrogate primary key that uniquely identifies the store. | ||||
A surrogate primary key that uniquely identifies the store. Identity / Auto increment column |
||||||||
2 | manager_staff_id | unsigned tinyint(3, 0) | staff | A foreign key identifying the manager of this store. | ||||
A foreign key identifying the manager of this store. References: staff |
||||||||
3 | address_id | unsigned smallint(5, 0) | address | A foreign key identifying the address of this store. | ||||
A foreign key identifying the address of this store. References: address |
||||||||
4 | last_update | timestamp | Default: CURRENT_TIMESTAMP | The time that the row was created or most recently updated. | ||||
The time that the row was created or most recently updated. Default: CURRENT_TIMESTAMP |
Relations
Foreign table | Primary table | Join | Title / Name / Description | |
---|---|---|---|---|
store | address | store.address_id = address.address_id | fk_store_address Foreign key constraint referencing address.address_id |
|
store.address_id = address.address_id Name: fk_store_addressForeign key constraint referencing address.address_id |
||||
store | staff | store.manager_staff_id = staff.staff_id | fk_store_staff Foreign key constraint referencing staff.staff_id |
|
store.manager_staff_id = staff.staff_id Name: fk_store_staffForeign key constraint referencing staff.staff_id |
||||
customer | store | customer.store_id = store.store_id | fk_customer_store Foreign key constraint referencing store.store_id |
|
customer.store_id = store.store_id Name: fk_customer_storeForeign key constraint referencing store.store_id |
||||
inventory | store | inventory.store_id = store.store_id | fk_inventory_store Foreign key constraint referencing store.store_id |
|
inventory.store_id = store.store_id Name: fk_inventory_storeForeign key constraint referencing store.store_id |
||||
staff | store | staff.store_id = store.store_id | fk_staff_store Foreign key constraint referencing store.store_id |
|
staff.store_id = store.store_id Name: fk_staff_storeForeign key constraint referencing store.store_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PRIMARY | store_id | Primary key. | |
Primary key. | |||
idx_unique_manager | manager_staff_id | Unique index. | |
Unique index. |
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44