- 创建一个外键命令
create table test1 ( name char(20) primary key, age int ); create table test2( name char(20) primary key, age int, secondname char(20), foreign key(secondname) references test1(name));
转载于:https://www.cnblogs.com/popping57/p/3245681.html
create table test1 (
name char(20) primary key,
age int
);
create table test2(
name char(20) primary key,
age int,
secondname char(20),
foreign key(secondname) references test1(name));
转载于:https://www.cnblogs.com/popping57/p/3245681.html