The store table
This article introduces the structure of the store table in the Sakila database.
The store table lists all stores in the system. All inventory is assigned to a specific store, and employees and customers are assigned to a “nearby store”.
The store table refers to the staff and address tables using foreign keys.
The inventory table refers to store table using a foreign key.
The customer table refers to store table using a foreign key.
The staff table refers to store table using a foreign key.
Table Structure
The structure of the store table is as follows:
+------------------+-------------------+------+-----+-------------------+-----------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+-------------------+------+-----+-------------------+-----------------------------------------------+
| store_id | tinyint unsigned | NO | PRI | NULL | auto_increment |
| manager_staff_id | tinyint unsigned | NO | UNI | NULL | |
| address_id | smallint unsigned | NO | MUL | NULL | |
| last_update | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+------------------+-------------------+------+-----+-------------------+-----------------------------------------------+
Table Columns
The following table explains all columns in the store table.
| Column | Description |
|---|---|
store_id |
The surrogate primary key that uniquely identifies the store. |
manager_staff_id |
The foreign key identifying the store manager. |
address_id |
The foreign key identifying the address of this store. |
last_update |
The time when the row was created or last updated. |