Oracle建表

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);

原文地址:https://www.cnblogs.com/ymf123/p/4912485.html