首页 > 数据库技术 > 详细

Oracle建表脚本记录

时间:2016-10-19 09:32:13      阅读:232      评论:0      收藏:0      [点我收藏+]
--删除
drop table dianfei;
--创建表
create table dianfei
(
uon varchar2(10) not null,
mmonth  varchar2(6) not null,
ddf number(6,2) not null,
djftime date not null,
djfzt varchar2(3) not null,
dsyjf date not null
);
--注释
comment on table dianfei is ‘电表‘;
comment on column dianfei.uon is ‘用户编号(从键)‘;
comment on column dianfei.mmonth is ‘缴费月份(从键)‘;
comment on column dianfei.ddf is ‘电费金额‘;
comment on column dianfei.djftime is ‘缴费日期‘;
comment on column dianfei.djfzt is ‘缴费状态‘;
comment on column dianfei.dsyjf is ‘上月缴费日期‘;
--创建主键,从键
alter table dianfei add constraint pk_dianfei foreign key (uon)
references uuser (uon);
alter table dianfei add constraint pk_dianfeia foreign key (mmonth)
references money (mmonth);

 

Oracle建表脚本记录

原文:http://www.cnblogs.com/tfl-511/p/5975931.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!