一个表只能有一个主键
create table price
(
Scode char(2),
pcode char(2),
price number(7,2),
CONSTRAINT PK_fh PRIMARY KEY (scode, pcode)
)
create table price
(
Scode char(2),
pcode char(2),
price number(7,2),
CONSTRAINT PK_fh PRIMARY KEY (scode, pcode)
)
2 (
3 Scode char(2) ,
4 pcode char(2) ,
5 price number(7,2),
6 Constraint pcode_pk Primary Key(scode,pcode)
7 )
8 ;表已创建。
create table price
(
Scode char(2) Constraint Scode_pk Primary Key,
pcode char(2) pcode_pk not null,
price number(7,2)
)create unique index I_PRICE_PCODE on price(pcode);primary key其实就是unique index + not null