我出于某种原因无法创建表格,我只是不断收到以下错误。
ERROR 1005(HY000):无法创建表'onesec.students'(错误号:121)
create table students (
student_id int not null,
fname varchar(34),
lname varchar(34),
unitid int,
lectid int,
primary key (lectid),
constraint unitFK foreign key (unitid) references units(unitid),
constraint lectFK foreign key (lectid) references lecturers(lectid));
任何人都知道为什么?感谢帮助。
对不起,伙伴们继承了另外两张桌子
create table unit (
unitid int primary key,
unit_name varchar(34));
create table lecturers (
lectid int not null,
fname varchar(34),
lname varchar(34),
unitid int,
primary key (lectid),
constraint unitFK foreign key (unitid) references units(unitid);