博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PowerDesigner建表
阅读量:7100 次
发布时间:2019-06-28

本文共 4863 字,大约阅读时间需要 16 分钟。

SQL:

--建表--管理人员表 admin--drop table WPADMIN cascade constraints;/*==============================================================*//* Table: ADMIN                                                 *//*==============================================================*/create table WPADMIN (   ADMIN_LOGINNAME      varchar2(10)         not null,   ADMIN_PASSWORD       varchar2(10)         not null,   ADMIN_NAME           varchar(4)           not null,   constraint PK_ADMIN primary key (ADMIN_LOGINNAME));comment on table WPADMIN is'管理员表';comment on column WPADMIN.ADMIN_LOGINNAME is'管理员用户名';comment on column WPADMIN.ADMIN_PASSWORD is'管理员密码';comment on column WPADMIN.ADMIN_NAME is'管理员姓名';--用户基本信息表  user--drop table USERS cascade constraints;/*==============================================================*//* Table: USERS                                                 *//*==============================================================*/create table USERS (   USER_LOGINNAME       varchar2(10)         not null,   USER_PASSWORD        varchar2(10)         not null,   USER_NAME            varchar2(4)          not null,   USER_ADRESS          varchar2(20)         not null,   USER_PHONE           number(11)           not null,   constraint PK_USERS primary key (USER_LOGINNAME));comment on table USERS is'用户表';comment on column USERS.USER_LOGINNAME is'用户用户名';comment on column USERS.USER_PASSWORD is'用户密码';comment on column USERS.USER_NAME is'用户姓名';comment on column USERS.USER_ADRESS is'用户住址';comment on column USERS.USER_PHONE is'用户联系方式';--水表 water--drop table WATER cascade constraints;/*==============================================================*//* Table: WATER                                                 *//*==============================================================*/create table WATER (   WATER_ID             varchar2(10)         not null,   USERID               varchar2(10)         not null,   WATER_TIME           date                 not null,   WATER_COUNT          number(4,2)          not null,   WATER_BEFORECOUNT    number(4,2)          not null,   WATER_USE            number(4,2)          not null,   WATER_PRICE          number(3,2)          not null,   STATUS               number(1)            not null,   constraint PK_WATER primary key (WATER_ID));comment on table WATER is'水费表';comment on column WATER.WATER_ID is'水费单id';comment on column WATER.USERID is'用户id(用户用户名)';comment on column WATER.WATER_TIME is'水费时间';comment on column WATER.WATER_COUNT is'当月水表数';comment on column WATER.WATER_BEFORECOUNT is'上月水表数';comment on column WATER.WATER_USE is'当月用水量=当月水表数-上月水表数water_use=water_count-water_beforecount';comment on column WATER.WATER_PRICE is'当月水费';comment on column WATER.STATUS is'缴费状态:0:未缴费  1:已缴费';--电表 power--drop table POWER cascade constraints;/*==============================================================*//* Table: POWER                                                 *//*==============================================================*/create table POWER (   POWER_ID             varchar2(10)         not null,   USERID               varchar2(10)         not null,   POWER_TIME           date                 not null,   POWER_COUNT          number(4,2)          not null,   POWER_BEFORECOUNT    number(4,2)          not null,   POWER_USE            number(4,2)          not null,   POWER_PRICE          number(3,2)          not null,   STATUS               number(1)            not null,   constraint PK_POWER primary key (POWER_ID));comment on table POWER is'电费表';comment on column POWER.POWER_ID is'电费单id';comment on column POWER.USERID is'用户id(用户用户名)';comment on column POWER.POWER_TIME is'电费时间';comment on column POWER.POWER_COUNT is'当月电表数';comment on column POWER.POWER_BEFORECOUNT is'上月电表数';comment on column POWER.POWER_USE is'当月用电量=当月电表数-上月电表数power_use=power_count-power_beforecount';comment on column POWER.POWER_PRICE is'当月电费';comment on column POWER.STATUS is'缴费状态:0:未缴费  1:已缴费';--价格表 money--drop table PRICE cascade constraints;/*==============================================================*//* Table: PRICE                                                 *//*==============================================================*/create table PRICE (   PRICEID              varchar2(10)         not null,   "DATE"               date                 not null,   WATER_PRICE          number(3,2)          not null,   POWER_PRICE          number(3,2)          not null,   ISACTIVE             number(1)            not null,   constraint PK_PRICE primary key (PRICEID));comment on table PRICE is'价格表';comment on column PRICE.PRICEID is'价格id';comment on column PRICE."DATE" is'当前价格时间';comment on column PRICE.WATER_PRICE is'水费单价';comment on column PRICE.POWER_PRICE is'电费单价';comment on column PRICE.ISACTIVE is'价格状态:0:当前价格失效                 1:当前价格有效';

 

转载于:https://www.cnblogs.com/jingzhenhua/p/5968929.html

你可能感兴趣的文章
项目测试随笔
查看>>
poj3261 -- Milk Patterns
查看>>
HttpClient获取返回类型为JSON或XML的数据
查看>>
python 自动化对比返回结果
查看>>
SQLite分页语句
查看>>
cesiumjs开发实践(六) CZML
查看>>
Delphi窗体中禁用最大化按钮
查看>>
K均值
查看>>
基于FPGA的dds发生器与lcd显示参数
查看>>
HDU-6216 A Cubic number and A Cubic Number [二分]
查看>>
php单例模式的使用场景,使用方法
查看>>
fetch请求get方式以及post提交参数为formdata类型的数据
查看>>
[学习笔记]凸优化/WQS二分/带权二分
查看>>
CentOS 下 LVS集群( 可能更新 )
查看>>
差分信号(Differential Signal)
查看>>
Aix项目_shell_rsh_01
查看>>
HDU 5726 GCD 求给定序列中与查询段相等的GCD个数
查看>>
JavaScript基础-2
查看>>
python实训第四天
查看>>
5-4-3原则
查看>>