Oracle新建表

-- Create table
create table T_HQ_B
(
  xzingm VARCHAR2(10),
  zhuz   VARCHAR2(20),
  zhis   NUMBER,
  bianh  VARCHAR2(10) not null
)

  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Add comments to the columns 
comment on column T_HQ_B.xzingm
  is '姓名';
comment on column T_HQ_B.zhuz
  is '住址';
comment on column T_HQ_B.zhis
  is '智商';
comment on column T_HQ_B.bianh
  is '编号';
-- Create/Recreate primary, unique and foreign key constraints 
alter table T_HQ_B
  add constraint PK_ZHIS primary key (BIANH)
  
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Create/Recreate check constraints 
alter table T_HQ_B
  add constraint CHECK_ZHIS
  check (zhis >= 50 and zhis < 250);

 

posted @ 2015-10-26 08:42  呼哧呼哧  阅读(212)  评论(0编辑  收藏  举报