資料庫 水電費繳費系統

2022-08-22 13:24:13 字數 4336 閱讀 6105

水電繳費管理系統資料表設計

sql建表指令碼:

--建表

--管理人員表 admin

create table admin(

admin_id varchar2(3) not null,

admin_loginname varchar2(8) not null,

admin_password varchar2(6) not null,

admin_username varchar2(4) not null,

constraint pk_admin primary key(admin_id)

);comment on column admin.admin_id is '管理員編號';

comment on column admin.admin_loginname is '管理員登入使用者名稱';

comment on column admin.admin_password is '管理員登入密碼';

comment on column admin.admin_username is '管理員姓名';

--使用者基本資訊表 user

create table users(

user_id varchar2(10) not null,

user_loginname varchar2(8) not null,

user_password varchar2(6) not null,

user_username varchar2(4) not null,

user_address varchar2(20) not null,

user_phone number(11) not null,

constraint pk_users primary key(user_id)

);comment on column users.user_id is '使用者編號';

comment on column users.user_loginname is '使用者登入名';

comment on column users.user_password is '使用者登入密碼';

comment on column users.user_username is '使用者姓名';

comment on column users.user_address is '使用者位址';

comment on column users.user_phone is '使用者**';

--水表 water

create table water(

water_id varchar2(10) not null,

userid varchar2(10) not null,

water_count number(3,2) not null,

water_time date not null,

water_status number(1) not null,

water_priceid varchar2(10) not null,

water_beforecount number(3,2) not null,

constraint pk_water primary key(water_id)

);comment on column water.water_id is '水表編號';

comment on column water.userid is '使用者編號';

comment on column water.water_count is '水表跑數';

comment on column water.water_time is '水表時間';

comment on column water.water_status is '水費繳費狀態';

comment on column water.water_priceid is '水費**編號';

comment on column water.water_beforecount is '上月水表跑數';

--水表 power

create table power(

power_id varchar2(10) not null,

userid varchar2(10) not null,

power_count number(3,2) not null,

power_time date not null,

power_status number(1) not null,

power_priceid varchar2(10) not null,

power_beforecount number(3,2) not null,

constraint pk_power primary key(power_id)

);comment on column power.power_id is '電表編號';

comment on column water.userid is '使用者編號';

comment on column power.power_count is '電表跑數';

comment on column power.power_time is '電表時間';

comment on column power.power_status is '電費繳費狀態';

comment on column power.power_priceid is '電費**編號';

comment on column power.power_beforecount is '上月電表跑數';

--**表 money

create table price(

price_id varchar2(10) not null,

price_time date not null,

isactive number(1) not null,

waterprice number(2,2) not null,

powerprice number(2,2) not null,

constraint pk_price primary key(price_id)

);comment on column price.price_id is '**編號';

comment on column price.price_time is '**日期';

comment on column price.isactive is '**狀態';

comment on column price.waterprice is '水費**';

comment on column price.powerprice is '電費**';

管理員表:

水費表:

電費表:

**表:

資料庫系統 資料庫 資料庫管理系統 資料庫系統

繼續寫資料庫系統的文章,第二篇 資料庫 資料庫管理系統 資料庫系統。本文主要談談這三者之間的關係。下方,摘自老師的ppt,非原創。資料庫管理系統 從系統角度看資料庫管理系統 資料庫系統 資料庫指的是長期儲存在計算機內有組織的,大量的,相關聯的,可共享的資料集合。資料應當是有組織的,不應該是雜亂無章的...

資料庫 資料庫系統 資料庫管理系統

資料庫 db table 例子如下 資料庫管理系統 dbms dbms的主要功能 定義功能 提供資料定義語言 ddl 定義db的 結構 兩級映象 定義資料的完整性約束 保密限制等 操縱功能 提供資料操作語言 dml 實現對資料的檢索和更新 詢問 插入 刪除 保護功能 db的恢復 的併發控制 資料完整...

基於C 和ACCESS資料庫實現的水電管理資訊系統

1 需求和規格說明 設計乙個水電管理資訊系統,能夠對高校的水電費用進行管理,包括了登記費用,查詢費用,以及住戶資訊管理等。在設計時要考慮到學生和教工在用水電時的不同,學生可以免費使用一定額度的水電,超過這個額度的隨便以後必須自費使用,且自費部分水電費的 標準要高於教工的收費標準 主要是節約資源 實現...