MySQL联级操作,下面的代码不知道哪里错了,MySQL5.7版本
CREATETABLEa(namechar(20)NOTNULL,idchar(20)NOTNULL,PRIMARYKEY(id))ENGINE=InnoDBDEFAUL...
CREATE TABLE a (
name char(20) NOT NULL,
id char(20) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create table b(
b_name char(20) not null,
b_id char(20) not null,
constraint kf_1 foreign key(b_id)
references a(id) on delete cascade on updata cascade)ENGINE=InnoDB DEFAULT CHARSET=utf8;
----------------------------------------------------------------------------------------------------------------------------------
创建b表的时候出现下面的错误,错在哪了呢?
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kf_1 foreign key(b_id)
references a(id) on delete cascade on updata cascad' at line 4 展开
name char(20) NOT NULL,
id char(20) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create table b(
b_name char(20) not null,
b_id char(20) not null,
constraint kf_1 foreign key(b_id)
references a(id) on delete cascade on updata cascade)ENGINE=InnoDB DEFAULT CHARSET=utf8;
----------------------------------------------------------------------------------------------------------------------------------
创建b表的时候出现下面的错误,错在哪了呢?
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kf_1 foreign key(b_id)
references a(id) on delete cascade on updata cascad' at line 4 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询