數據庫表設計—水電費繳費系統


 水電繳費管理系統數據表設計

 

SQL建表腳本:

 1 --建表
 2 --管理人員表 admin
 3 create table admin(
 4        admin_id      varchar2(3) not null,
 5        admin_loginname           varchar2(8) not null,
 6        admin_password            varchar2(6) not null,
 7        admin_username            varchar2(4) not null,
 8        constraint pk_admin primary key(admin_id)
 9 );
10 comment on column admin.admin_id is '管理員編號';
11 comment on column admin.admin_loginname is '管理員登錄用戶名';
12 comment on column admin.admin_password is '管理員登錄密碼';
13 comment on column admin.admin_username is '管理員姓名';
14 --用戶基本信息表  user
15 create table users(
16        user_id    varchar2(10) not null,
17        user_loginname           varchar2(8) not null,
18        user_password            varchar2(6) not null,
19        user_username            varchar2(4) not null,
20        user_address             varchar2(20) not null,
21        user_phone               number(11) not null,
22        constraint pk_users primary key(user_id)
23 );
24 comment on column users.user_id is '用戶編號';
25 comment on column users.user_loginname is '用戶登錄名';
26 comment on column users.user_password is '用戶登錄密碼';
27 comment on column users.user_username is '用戶姓名';
28 comment on column users.user_address is '用戶地址';
29 comment on column users.user_phone is '用戶電話';
30 --水表 water
31 create table water(
32        water_id   varchar2(10) not null,
33        userid     varchar2(10) not null,
34        water_count             number(3,2) not null,
35        water_time              date not null,
36        water_status            number(1) not null,
37        water_priceid           varchar2(10) not null,
38        water_beforecount       number(3,2) not null,
39        constraint pk_water primary key(water_id)       
40 );
41 comment on column water.water_id is '水表編號';
42 comment on column water.userid is '用戶編號';
43 comment on column water.water_count is '水表跑數';
44 comment on column water.water_time is '水表時間';
45 comment on column water.water_status is '水費繳費狀態';
46 comment on column water.water_priceid is '水費價格編號';
47 comment on column water.water_beforecount is '上月水表跑數';
48 --水表 power
49 create table power(
50        power_id   varchar2(10) not null,
51        userid     varchar2(10) not null,
52        power_count             number(3,2) not null,
53        power_time              date not null,
54        power_status            number(1) not null,
55        power_priceid           varchar2(10) not null,
56        power_beforecount       number(3,2) not null,
57        constraint pk_power primary key(power_id)       
58 );
59 comment on column power.power_id is '電表編號';
60 comment on column water.userid is '用戶編號';
61 comment on column power.power_count is '電表跑數';
62 comment on column power.power_time is '電表時間';
63 comment on column power.power_status is '電費繳費狀態';
64 comment on column power.power_priceid is '電費價格編號';
65 comment on column power.power_beforecount is '上月電表跑數';
66 --價格表 money
67 create table price(
68        price_id   varchar2(10) not null,
69        price_time date not null,
70        isactive   number(1) not null,
71        waterprice number(2,2) not null,
72        powerprice number(2,2) not null, 
73        constraint pk_price primary key(price_id)  
74 );
75 comment on column price.price_id is '價格編號';
76 comment on column price.price_time is '價格日期';
77 comment on column price.isactive is '價格狀態';
78 comment on column price.waterprice is '水費價格';
79 comment on column price.powerprice is '電費價格';

管理員表:

用戶表:

水費表:

電費表:

價格表:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM