MySQL的外键插入

为已经添加好的数据表添加外键: 语法:alter table 表名 add constraint FK_ID foreign key(你的外键字段名) REFERENCES 外表表名(对应的表的主键字段名); 例: alter table tb_active add constraint FK_ID foreign key(user_id) REFERENCES tb_user(id) //FK_
相关文章
相关标签/搜索