1.创建外键,关联两个表
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
时间: 2024-10-11 00:45:00