先创建个表:
1)
create table test
(
sno char(12),
name char(4),
CONSTRAINT PK_TAB PRIMARY KEY (sno,name) -- 联合主键
);
2)
创建表之后追加联合主键:
alter table test add constraint pk_tab2 primary key (sno,name);
时间: 2024-12-07 08:31:06
先创建个表:
1)
create table test
(
sno char(12),
name char(4),
CONSTRAINT PK_TAB PRIMARY KEY (sno,name) -- 联合主键
);
2)
创建表之后追加联合主键:
alter table test add constraint pk_tab2 primary key (sno,name);