課程:網路資料庫班級: 學號: 姓名:
儀器編號 13 實驗日期 2010-06-17
實驗:四、簡單的超市管理系統的設計與實現
實驗目的:
1. 進一步熟悉oracle的各種操作;
2. 能夠在實際的例項中靈活運用學到的有關知識;
3. 通過本次實驗,了解到軟體系統建立資料庫的過程,以便日後自己在做軟體系統中,能夠進行各種資料庫操作。
實驗環境:
windows xp + oracle 11g + microsoft word 2000
實驗內容:(可用附頁)
見附頁實驗結果:(可用附頁)
見附頁小型超市管理系統資料庫的設計
資料庫設計是對於乙個給定的應用環境,構建乙個最優的資料庫模式,並據此建立既能有效、完整、安全儲存資料的資料庫,又能滿足多個使用者的資訊要求和處理要求的應用系統,
本資料庫設計就是為了能夠在很好的管理超市的所有資料而進行設計。(結合資料庫設計和你要完成的系統進行陳述)。
資料庫設計的過程包含需求分析、概念結構設計、邏輯結構設計、物理結構設計、應用的設計。下面就按照資料庫設計的過程進行逐一陳述
一、需求分析
1. 系統設計的意義
(1)大大提高超市的運作效率;
(2)通過全面的資訊採集和處理,輔助提高超市的決策水平;
(3)使用本系統,可以迅速提公升超市的管理水平,為降低經營成本, 提高效益,增強超市擴張力, 提供有效的技術保障。
2. 需求收集
(1)商品資訊表
(2)使用者(員工)表
(3)會員表
(4)會員消費記錄表
3. 業務邏輯分析
商品錄入:快速錄入商品、支援條形碼掃瞄
收銀業務:計算交易總額、列印交易清單、根據會員卡打折
銷售管理:商品銷售控制、查詢列印銷售情況、生成銷售排行榜
人員管理:基本資訊登記管理、員工操作許可權管理、客戶銷售許可權管理
4.具體功能分析
二、概念結構設計
1、區域性e—r圖
(1) 使用者(員工)
(2) 商品
(3) 會員
(4)會員消費記錄
2、各實體間的聯絡
三、邏輯結構的設計
商品資訊表
使用者表會員表
會員消費記錄表
四、物理結構設計
1、建立表空間
create tablespace ztftp
logging
datafile 'd:\app\administrator\oradata\orcl\ztftp01.dbf'
size 50m
autoextend on
next 32m maxsize 2048m
extent management local;
2、建立使用者並使用上面的表空間並賦予使用表空的許可權
create user ztf07113 identified by ztf1987
default tablespace ztftp
temporary tablespace temp;
alter user ztf07113
default tablespace ztftp
quota 10m on ztftp;
3、賦予使用者系統許可權
grant create session to ztf07113;
grant sysdba to ztf07113;
grant create table to ztf07113;
grant select any table to ztf07113;
grant alter any table to ztf 07113;
grant drop any table to ztf07113;
grant create view to ztf07113;
grant create any trigger to ztf07113;
4、建立基本表
/***建立商品資訊表
**/create table goodsinfo
( goodsid number(4),
goodsname varchar2(50),
goodsprice number(4)
);/**
*建立使用者表
**/create table user
( userid number(10),
username varchar2(25),
userpw number(38),
userstyle number(4)
);/**
*建立會員表
**/create table member
( memberid number(10),
membername varchar2(20),
totalcost number(4),
regdate number(8)
);/**
*會員消費記錄表
**/create table expense
( memberid number(10),
goodsid number(4)
);5、建立觸發器
/***當消費記錄表中增加一條記錄後,則更新會員表中的累計消費金額
**/create or replace trigger
after insert on expense
for each row
declare
price number;
begin
select goodsinfo.goodsprice into price
from goodsinfo,expense
where goodsinfo.goodsid = expense.goodsid and goodsinfo.goodsid = :new.goodsid;
update member
set totalcost = totalcost + price
where member.memberid = expense.memberid;
end;
6、建立檢視
/***檢視會員編號為***的消費記錄檢視
**/create view aaa
asselect member.memberid, goodsinfo.goodsname
from goodsinfo,member,expense
where member.memberid=expense.memberid and expense.goodsid=goodsinfo.goodsid
/***檢視累計消費在100元以上的會員編號檢視
**/create view bbb
as select member.memberid,member.totalcost
from member;
7.測試用例
insert into goodsinfo
values("00001","可口可樂","3.5");
insert into goodsinfo
values("00002","鄉巴佬雞腿","5.0");
insert into goodsinfo
values("00003","洽洽瓜子","4.5");
insert into goodsinfo
values("00004","旺旺雪餅","4.5");
insert into user
values("01","朱鐵鋒","12345","收銀員");
insert into user
values("02","楊建","12345","收銀員");
insert into user
values("03","陳定苗","12345","搬運工");
insert into user
values("04","嚴小林","12345","搬運工");
insert into member
values("00001","周建東","500","2010-01-01");
insert into member
values("00002","吳育鋒","200","2010-01-01");
insert into member
values("00003","封建林","250","2010-01-01");
insert into expense
values("00001","00002");
insert into expense
values("00002","00001");
insert into expense
values("00003","00004");
insert into expense
values("00004","00003");
五、小結
和傳統管理模式相比較,使用本系統,毫無疑問會大大提高超市的運作效率,輔助提高超市的決策水平,管理水平,為降低經營成本, 提高效益,減少差錯,節省人力,減少顧客購物時間,增加客流量,提高顧客滿意度,增強超市擴張能力, 提供有效的技術保障。
由於開發者能力有限,加上時間倉促,本系統難免會出現一些不足之處,例如:
1) 本系統只適合小型超市使用,不能適合中大型超市使用;
2)超市管理系統涉及範圍寬,要解決的問題多,功能複雜,實現困難,但由於限於時間,本系統只能做出其中的一部分功能;
對於以上出現的問題,只能深表歉意,如發現還有其它問題,希望老師批評指正。
《超市管理系統》資料庫設計報告
資料庫設計報告 檔名稱 資料庫設計報告 編制人 0703j第二專案小組 編制日期 2009 09 13 審核人 版本 v1.0 資料庫設計說明書 第1章引言 1.1編寫目的 本資料庫表主要是為程式開發人員設計而編寫的。為開發人員提供開發指導 為客戶提供資料設計 為測試人員提供測試指導和為管理人員提供...
超市前台管理系統資料庫設計
超市前台管理系統 班級 學號 姓名 1 設計題目 超市收銀管理系統資料庫設計 2 可行性分析 超市是乙個很繁忙的地方,每天有很多的顧客要買東西,收銀員要和很多的顧客結算,並且要給這些結算存檔,以便日後檢視。如果只用人工的方法去處理這些結算和計算的資料將是一件很繁瑣的事情,將投入大量的人力物力,為了解...
超市管理系統資料庫課程設計
信工學院 資料庫課程設計 題目 超市進銷存管理系統資料庫設計 超市進銷存管理系統資料庫設計 學生姓名 xx xx08電腦科學與技術x班 摘要本次實習的題目是超市進銷存管理系統,主要的目的是在超市進銷存模組的基礎上對超市的經營 管理進行研究和 根據系統所需功能,決定以windows xp為開發平台,採...