zoukankan      html  css  js  c++  java
  • 水电缴费管理系统-数据库表格创建

    create table admin
    (
    aid varchar2(10) not null,
    apassword  varchar2(8) not null,
    aphone  varchar2(11) not null,
    aname varchar2(8) not null
    );
    comment on table admin is '管理员登录';
    comment on column admin.aid is '管理编号(主键)';
    comment on column admin.apassword is '登录密码';
    comment on column admin.aphone is '管理员电话';
    comment on column admin.aname is '管理员姓名';
    alter table admin add constraint pk_admin primary key (aid);

    drop table uuser;
    
    create table uuser
    (
    uon varchar2(15) not null,
    uname varchar2(8) not null,
    uphone  varchar2(11) not null,
    upassword varchar2(8) not null,
    uaddress  varchar2(60) not null
    
    );
    comment on table uuser is '用户登录';
    comment on column uuser.uon is '用户编号(主键)';
    comment on column uuser.uname is '用户姓名';
    comment on column uuser.uphone is '用户电话';
    comment on column uuser.upassword is '用户登录密码';
    comment on column uuser.uaddress is '用户地址';
    
    alter table uuser add constraint pk_uuser primary key (uon);

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

    drop table shuifei;
    create table shuifei
    (
    uon varchar2(10) not null,
    mmonth  varchar2(6) not null,
    sdf number(6,2) not null,
    sjftime date not null,
    sjfzt varchar2(3) not null,
    ssyjf date not null
    );
    comment on table shuifei is '水表';
    comment on column shuifei.uon is '用户编号(从键)';
    comment on column shuifei.mmonth is '缴费月份(从键)';
    comment on column shuifei.sdf is '水费金额';
    comment on column shuifei.sjftime is '缴费日期';
    comment on column shuifei.sjfzt is '缴费状态';
    comment on column shuifei.ssyjf is '上月缴费日期';
    alter table shuifei add constraint pk_shuifei foreign key (uon)
    references uuser (uon);
    alter table shuifei add constraint pk_shuifeia foreign key (mmonth)
    references money (mmonth);

    drop table money;
    
    create table MONEY
    (
      mmonth varchar2(6) not null,
      mwater NUMBER(4,2) not null,
      mpower NUMBER(4,2) not null
    );
    comment on column MONEY.mmonth
      is '缴费月份(主键)';
    comment on column MONEY.mwater
      is '水费价格';
    comment on column MONEY.mpower
      is '电费价格';
      alter table MONEY add constraint pk_money primary key (mmonth);

  • 相关阅读:
    H50068:html页面清除缓存
    CSS0019: 样式中高度百分比无效时,这样写 height:calc(100%)
    H50067:body 背景颜色 背景图片 background 的 简写属性
    40、在last_update后面新增加一列名字为create_date
    39、使用强制索引查询
    38、针对actor表创建视图actor_name_view
    37、对first_name创建唯一索引uniq_idx_firstname,对last_name创建普通索引idx_lastname
    36、创建一个actor_name表,将actor表中的所有first_name以及last_name导入改表
    35、批量插入如下数据,不使用replace操作
    34、批量插入如下数据
  • 原文地址:https://www.cnblogs.com/tfl-511/p/5962103.html
Copyright © 2011-2022 走看看