create table score(
id int not null auto_increment,
subject char(32) not null,
stu_id int not null,
primary key(id),
key fk_stu_key (stu_id),
constraint fk_stu_key foreign key (stu_id) references student (stu_id));
原文:http://blog.51cto.com/13803166/2141837