create table school
{
schoolID int not null auto_increment primary key,
name varchar(100),
address varchar(200)
...
}
create table student
{
studentID int not null auto_increment primary key,
name varchar(50),
schoolID int not null references school(schoolID),
...
}能看明白吧,用references即可
{
schoolID int not null auto_increment primary key,
name varchar(100),
address varchar(200)
...
}
create table student
{
studentID int not null auto_increment primary key,
name varchar(50),
schoolID int not null references school(schoolID),
...
}能看明白吧,用references即可
用mysqlcc加不了
alter table product add foreign key (p_type) references type
执行之后怎么没什么反映阿?
是不是还要有什么提交语句 commit go之类的?哪位老大来指教一下~
但是不知道不可以乱说哦~会教坏小朋友滴