商店表 store
本文介绍了 Sakila 数据库中的 store 表的表结构以及与其他表的关系。
store 表列出了系统中的所有商店。所有库存都分配到特定的商店,员工和客户被分配到一个“附近的商店”。
store 表中定义了外键指向 staff 和 address 表。
store 表被 staff, customer 和 inventory 表中的外键引用。
表结构
store 表结构如下:
+------------------+-------------------+------+-----+-------------------+-----------------------------------------------+
| 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 |
+------------------+-------------------+------+-----+-------------------+-----------------------------------------------+
字段说明
| 字段 | 说明 |
|---|---|
store_id |
唯一标识商店的代理主键。 |
manager_staff_id |
标识该商店经理的外键。 |
address_id |
标识此商店地址的外键。 |
last_update |
该行的创建时间或最近更新时间。 |