常用的sql语句

-- 添加字段
alter table hist_trans add (sett_batch_no nvarchar2(50));
alter table hist_trans add (check_time date) ;
alter table hist_trans add (refund_status integer default 0) ;

-- 修改字段
alter table hist_trans modify mch_ev varchar2(100);

-- 删除字段
alter table hist_trans drop column refund_status ; 

-- 添加注释
comment on column hist_trans.refund_status is '退款状态:1为已退款,2为未退款';


-- 添加主键
alter table sys_syspara_info add constraint pk_sys_syspara_info primary key (si_id)

-- 添加外键
alter table sys_syspara_info add constraint fk_systype_ref_syspara foreign key (si_para_id) references sys_syspara_type (st_id);

-- 删除主键
alter table sys_syspara_info drop constraint pk_sys_syspara_info;

-- 删除外键
alter table sys_syspara_info drop constraint fk_systype_ref_syspara;

-- 创建索引
create index index_sb_bank_id on posp_subbranch (sb_bank_id)
tablespace qbposp
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
  ) ;


-- 创建序列
create sequence SYS_MER_ROLE_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 91
increment by 1 ;
cache 20;
 
 
-- 创建表
create table posp_news
(
  news_id            integer not null,
  news_title_cn      varchar2(100) not null,
  news_content_cn    varchar2(4000) not null,
  news_status        integer not null,
  news_expirydate    date not null,
  news_send_name     varchar2(50),
  news_send_time     date,
  news_remark        varchar2(1000)
)
tablespace qbposp
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
  );
 
 
 
 
 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值