wgbs25673578

创建用户

-- Create the user
create user U_HQ_JAVA
default tablespace USERS
temporary tablespace TEMP
profile DEFAULT
password expire;
-- Grant/Revoke role privileges
grant connect to U_HQ_JAVA;
grant dba to U_HQ_JAVA;
-- Grant/Revoke system privileges
grant unlimited tablespace to U_HQ_JAVA;

创建主键
-- Create/Recreate primary, unique and foreign key constraints
alter table T_U_HQ_JAVA
add constraint pk_xuhao primary key ();

创建表,添加列

-- Create table
create table T_U_HQ_JAVA
(
bum VARCHAR2(10),
rens NUMBER,
xiuxrx NUMBER,
suoxuhc VARCHAR2(60),
suoxhcsl NUMBER,
gongfeish NUMBER
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 100M
next 1M
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column T_U_HQ_JAVA.bum
is \'部门\';
comment on column T_U_HQ_JAVA.rens
is \'人数\';
comment on column T_U_HQ_JAVA.xiuxrx
is \'休假人数\';
comment on column T_U_HQ_JAVA.suoxuhc
is \'所需耗材\';
comment on column T_U_HQ_JAVA.suoxhcsl
is \'所需耗材数量\';
comment on column T_U_HQ_JAVA.gongfeish
is \'公费损耗\';
-- Create/Recreate check constraints

添加限制检查

alter table T_U_HQ_JAVA
add constraint CHECE_XIUXRX
check (xiuxrx < 2);

posted on 2015-10-25 23:44  我就不吃芹菜  阅读(221)  评论(0编辑  收藏  举报

分类:

技术点:

相关文章: