我正在用外键做一张桌子,这里是
create table PM_Team_Members
(
PM_Team_Members_ID int NOT NULL auto_increment PRIMARY KEY,
PM_Team_Members_firstName varchar(50) not null,
PM_Team_Members_middleName varchar(50) not null,
PM_Team_Members_lastName varchar(50) not null,
PM_Team_Members_address varchar(255) not null,
PM_Team_Members_contact numeric not null,
PM_Spec_id int,
constraint fk_PM_id foreign key (PM_Spec_id) references PM_Specialization(PM_Spec_id)
)
这是参考表
create table PM_Specialization
(
PM_Spec_ID int auto_increment PRIMARY KEY,
PM_Spec_Specialization varchar(50) not null,
PM_Spec_Description varchar(255) not null
)
当我单击GO查询时。它说MySQL returned an empty result set (i.e. zero rows). (Query took 0.2162 sec)
,我认为它是正确的。但随后一个弹出窗口显示Error:Token Mismatch
那个怎么样?我做错了什么或是某种错误?
答案 0 :(得分:1)
这部分references PM_Specialization(PM_Spec_id) )
PM_Specialization表中有PM_Spec_ID而不是PM_Spec_id。