码迷,mamicode.com
首页 > 数据库 > 详细

Oracle新建表

时间:2015-10-26 09:13:58      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

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

 

Oracle新建表

标签:

原文地址:http://www.cnblogs.com/zhuxiaolin/p/4910210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!