CREATE TABLE Users(
uid int(11) unsigned NOT NULL auto_increment,
name varchar(11) NOT NULL default '',
password int(6) NOT NULL default 0,
login_id varchar(11) NOT NULL default '',
PRIMARY KEY(uid)
)
CREATE TABLE Students(
uid int(11) unsigned NOT NULL,
e_mail varchar(80) NOT NULL default '',
phone varchar(11) NOT NULL default '',
PRIMARY KEY(uid),
FOREIGH KEY(uid) REFERENCES Users(uid)
on delete cascade on update cascade
)
老是报错,
取消on delete cascade on update cascade约束也没用,
请问是什么原因?
éäºä¸ªåæ¯ï¼ç´¯ææ¾éæ¾å天ï¼
uid int(11) unsigned NOT NULL,
e_mail varchar(80) NOT NULL default '',
phone varchar(11) NOT NULL default '',
PRIMARY KEY(uid),
FOREIGN KEY(uid) REFERENCES users(uid)
on delete cascade on update cascade
)
FOREIGH åºè¯¥æ¯ FOREIGNï¼æ¯ N ä¸æ¯H ã
追é®ååï¼å¤ªæè°¢ä½ äºï¼ï¼ï¼
温馨提示:答案为网友推荐,仅供参考