ORACLE之新建
创建一个名为INSURES的表
create table INSURES
(
INSURE_NO CHAR(18) not null,
GETSURE_UNIT_NO CHAR(9) not null,
INSURE_NAME VARCHAR2(10) not null,
INSURE_SEX CHAR(1) not null,
ID_CARD_NO CHAR(18) not null,.
.
.
)
给该表字段添加注释
comment on column INSURES.INSURE_NO
is '医保号';
comment on column INSURES.GETSURE_UNIT_NO
is '经办机构号';
comment on column INSURES.INSURE_NAME
is '姓名';
comment on column INSURES.INSURE_SEX
is '性别';
comment on column INSURES.ID_CARD_NO
is '身份证号';.
.
.
.
创建/修改主键,唯一性约束和外键 这里INSURE_NO, GETSURE_UNIT_NO唯一性约束
alter table INSURES
add constraint UNQ_INSURES unique (INSURE_NO, GETSURE_UNIT_NO)
alter table TWN_SEED
add constraint UNQ_INSURES primary key (。。。。)
创建索引
create index IDX_INSURES on INSURES (GETSURE_UNIT_NO, SONSURE_UNIT_NO, UNIT_NO, FAMILY_NO, HOSPS_NO)