为book表添加外键:
明确指定外键的名称:alter table book add constraint FK_BOOK foreign key(pubid) references pub_com(id) on delete restrict on update restrict;
不指定外键的名称,mysql会自动为你创建一个外键名称:alter table book add foreign key(pubid) references pub_com(id) on delete restrict on update restrict;
posted on 2008-08-09 23:43
邪恶K线图 阅读(316)
评论(0) 编辑 收藏 所属分类:
DB