您的位置:首页 > 博客中心 > 数据库 >

Oracle建表

时间:2022-03-14 15:40

create table T_HQ_E
(
xingm VARCHAR2(10),
chengj NUMBER not null,
jiatzz VARCHAR2(15)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 16K
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column T_HQ_E.xingm
is ‘姓名‘;
comment on column T_HQ_E.chengj
is ‘成绩‘;
comment on column T_HQ_E.jiatzz
is ‘家庭住址‘;
-- Create/Recreate primary, unique and foreign key constraints
alter table T_HQ_E
add constraint PK_T_HQ_JIATDZ primary key (CHENGJ)
using index
tablespace SYSTEM
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate check constraints
alter table T_HQ_E
add constraint CHECK_CHENGJ
check (chengj>60 and chengj <100);

本类排行

今日推荐

热门手游