#外键关联规则
key fk_当前表_关联表
(当前表外键),
constraint fk_当前表_关联表
foreign key (外键
) references 关联表
(关联表主键
) on delete cascade on update cascade
#需要注意的点
- 表名是否对应
- 表的字段是否对应
- 外键关联的键是否为另一张表的主键
#外键关联规则
key fk_当前表_关联表
(当前表外键),
constraint fk_当前表_关联表
foreign key (外键
) references 关联表
(关联表主键
) on delete cascade on update cascade
#需要注意的点