- 論壇徽章:
- 0
|
在數(shù)據(jù)庫中建了幾張表,但是建到這張的時(shí)候就出現(xiàn)了這個(gè)問題。
在這之前也出現(xiàn)了這個(gè)問題,但當(dāng)我將foreign key (Te_na) references teacher改成foreign key (Te_na) references teacher(Te_na)后就沒有這個(gè)問題了,但是到了這張表又就出現(xiàn)這個(gè)問題了
drop table if exists stu_app;
create table stu_app(
Te_na varchar(20) not null,
Stu_na varchar(20) not null,
Obj_title varchar(30) not null,
status char(4) default 'pend' not null,
primary key (Te_na),
foreign key (Stu_na) references student(Stu_na),
foreign key (Te_na) references teacher(Te_na)
);
Stu_na在student表中是主鍵, Te_na在teacher表中是主鍵,且都在stu_app表前建立了 |
|