当前位置:Gxlcms > 数据库问题 > 数据库10.12水费管理系统相关表格设计

数据库10.12水费管理系统相关表格设计

时间:2021-07-01 10:21:17 帮助过:1人阅读

技术分享

-- Create table
create table ADMIN
(
  gno       VARCHAR2(4) not null,
  gpassword VARCHAR2(8) not null,
  gname     VARCHAR2(9) not null,
  gphone    VARCHAR2(11)
);
-- Add comments to the columns 
comment on column ADMIN.gno
  is ‘管理员编号‘;
comment on column ADMIN.gpassword
  is ‘管理员密码‘;
comment on column ADMIN.gname
  is ‘管理员姓名‘;
comment on column ADMIN.gphone
  is ‘管理员电话‘;

-- Create/Recreate primary, unique and foreign key constraints 
alter table ADMIN
  add constraint PK_GNO primary key (GNO);

  技术分享

 

技术分享

-- Create table
create table USERZ
(
  uno       VARCHAR2(4) not null,
  uname     VARCHAR2(9) not null,
  upassword VARCHAR2(8) not null,
  uphone    VARCHAR2(11),
  usfje     NUMBER(8,2) not null,
  udfje     NUMBER(8,2) not null,
  uzje      NUMBER(8,2) not null,
  udate     DATE not null
);

-- Add comments to the columns 
comment on column USERZ.uno
  is ‘用户编号(主键)‘;
comment on column USERZ.uname
  is ‘用户姓名‘;
comment on column USERZ.upassword
  is ‘用户密码‘;
comment on column USERZ.uphone
  is ‘用户电话‘;
comment on column USERZ.usfje
  is ‘水费金额‘;
comment on column USERZ.udfje
  is ‘电费金额‘;
comment on column USERZ.uzje
  is ‘水电费总金额‘;
comment on column USERZ.udate
  is ‘缴费日期‘;

-- Create/Recreate primary, unique and foreign key constraints 
alter table USERZ
  add constraint PK_UNO primary key (UNO);

  技术分享

 

技术分享

-- Create table
create table WATER
(
  uno    VARCHAR2(4) not null,
  wmonth CHAR(6) not null,
  wyl    NUMBER(8,2) not null,
  usfje  NUMBER(6,2) not null
);

-- Add comments to the columns 
comment on column WATER.uno
  is ‘用户编号(主键)‘;
comment on column WATER.wmonth
  is ‘月份‘;
comment on column WATER.wyl
  is ‘用水量‘;
comment on column WATER.usfje
  is ‘水费金额(外键)‘;

-- Create/Recreate primary, unique and foreign key constraints 
alter table WATER
  add constraint PK_W_UNO primary key (UNO);

  技术分享

 

 

 

 

-- Create table
create table POWER
(
  uno    VARCHAR2(4) not null,
  pmonth CHAR(5) not null,
  pyl    NUMBER(8,2) not null,
  udfje  NUMBER(8,2)
);

-- Add comments to the columns 
comment on column POWER.uno
  is ‘用户编号(主键)‘;
comment on column POWER.pmonth
  is ‘电表月份‘;
comment on column POWER.pyl
  is ‘用电量‘;
comment on column POWER.udfje
  is ‘电费金额(外键)‘;

-- Create/Recreate primary, unique and foreign key constraints 
alter table POWER
  add constraint PK_P_UNO primary key (UNO);

  技术分享

 

数据库10.12水费管理系统相关表格设计

标签:

人气教程排行