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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- 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);

  

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- 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);

  

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- 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,
  wsfjf  CHAR(6) 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 '水费金额';
comment on column WATER.wsfjf
  is '是否缴费';
-- Create/Recreate primary, unique and foreign key constraints
alter table WATER
  add constraint FK_W_UNO foreign key (UNO)
  references USERZ (UNO);

  

  

 

 

 

 

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- 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),
  psfjf  CHAR(6) not null
);
-- 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 '电费金额';
comment on column POWER.psfjf
  is '是否缴费';
-- Create/Recreate primary, unique and foreign key constraints
alter table POWER
  add constraint FK_P_UNO foreign key (UNO)
  references USERZ (UNO);

  

 

  

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Create table
create table MONEY
(
  mmonth CHAR(5) not null,
  mwater NUMBER(4,2) not null,
  mpower NUMBER(4,2) not null
);
-- Add comments to the columns
comment on column MONEY.mmonth
  is '价格变更月份';
comment on column MONEY.mwater
  is '水费价格';
comment on column MONEY.mpower
  is '电费价格';

  

 

posted @   琢磨先生  阅读(374)  评论(0编辑  收藏  举报
编辑推荐:
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
阅读排行:
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Browser-use 详细介绍&使用文档
· 软件产品开发中常见的10个问题及处理方法
· Vite CVE-2025-30208 安全漏洞
AmazingCounters.com
点击右上角即可分享
微信分享提示