超市pos系统的数据库设计.doc
更新时间:2023-05-04 23:32:01 阅读量: 实用文档 文档下载
- 超市POS机推荐度:
- 相关推荐
超市POS管理系统
数据库设计
数据库在一个信息管理系统中占有非常重要的地位,数据库结构的设计好坏将直接对应用系统的效率以及实现的效果产生影响。数据库设计一般包括以下四个部分:数据库需求分析、数据库概念结构设计、数据库逻辑结构设计、数据库物理结构实现。
一、数据库需求分析
通过对超市管理工作过程的内容和数据流图分析,设计如下面的数据项和数据结构。
1、员工信息,包括的数据项有:员工编号,姓名,性别,职务,口令,权限级别、身份证号,所属部门编号等。
2、部门信息,包括的数据项有:部门编号,部门名称。
3、供应商信息,包括的数据项有:供应商编号,供应商名称,地址,邮政编码,电话号码,税号,银行帐号,开户银行,联系人,备注等。
4、会员信息,包括的数据项有:会员编号,姓名,性别,身份证号,消费总金额,积分等。
5、入库信息,包括的数据项有:入库编号,入库日期,商品编号,计量单位,入库价格,销售价格,数量,总金额,供应商编号,业务员编号等。
6、商品信息,包括的数据项有:商品编号,所属类别,数量,单价,商品名称等。
7、销售出货单主信息,包括的数据项有:销售日期,总金额,是否现金,是否会员,会员编号、收银号编号等。
8、销售出货单子信息,包括的数据项有:商品编号,数量,单价,折扣比例,金额等。
二、数据库概念结构设计
根据上面设计规划出的实体,我们对各个实体具体的描述E-R图如下:
图1 员工信息E-R 图
图2 部门信息E-R 图
图3 入库信息E-R 图
图4 商品信息E-R 图
图5 销售出货单主信息E-R图
图6 销售出货单子信息E-R图
图7 会员信息E-R图
图8 供应商信息E-R图
实体与实体之间的关系E-R图:
三、数据库逻辑结构设计
四、数据库物理结构实现
根据以上的逻辑分析所得到表的关系,我们使用T-SQL语言设计得到数据库和数据表。
1.create database glxt
on
( name=pos_dat,
filename='D:\pos_dat.mdf',
size=5,
maxsize=20,
filegrowth=1)
LOG on
( name=pos_log,
filename='D:\pos_log.ldf',
size=5,
maxsize=20,
filegrowth=1)
2.create table bm
(bmbh char(8) not null
constraint PK_bno primary key,
bmmc char(4) not null
)
go
3.create table sp
(spbh char(8) not null
constraint PK_cno primary key,
spmc varchar(20) not null ,
sslb char(8) not null,
sl int not null,
jg money not null
)
go
4.create table gys
(gysbh char(8) not null
constraint PK_dno primary key,
gysmc char(8) not null,
dz varchar(20) not null,
yzbm char(8) not null,
dhhm varchar(15) not null,
sh varchar(3) not null,
yhzh varchar(20) not null,
khyh char(8) not null,
lxr char(8) not null,
beizhu text null
)
go
5.create table hy
(hybh char(8) not null
constraint PK_eno primary key,
hyname char(6)not null,
sex char(2) check CK_hy sex in (‘男’,’女’) not null, sfzh varchar(20) not null,
xfzje money not null,
jf int not null
)
Go
6.create table yg
(ygbh char(8) not null
constraint PK_fno primary key,
ygname char(8) not null,
sex char(2) check CK_yg sex in (‘男’,’女’) not null,
zw char(8) not null,
kl varchar(20) not null,
qxjb char(4) not null,
sfzh varchar(18) not null,
ssbmbh char(8) not null
constraint FK_ano foreign key references bm(bmbh) )
go
7.create table rk
(rkbh char(8) not null
constraint PK_gno primary key,
xsjg money not null,
rkrq datetime not null,
spbh char(8) not null
constraint FK_bno foreign key references sp(spbh), ywybh char(8) not null
constraint FK_cno foreign key references yg(ygbh), jldw char(2) not null,
rkjg money not null,
gysbh char(8) not null
constraint FK_dno foreign key references gys(gysbh),
zje money not null,
sl int not null
)
go
8.create table zhuxx
(xsrq datetime not null,
zje money not null,
sfxj char(2) check CK_zhuxx_sfxj in (‘是’,’否’) not null , sfhy char(2) check CK_zhuxx_sfhy in (‘是’,’否’) ,
hybh char(8) not null
constraint FK_eno foreign key references hy(hybh), syybh char(8) not null
constraint FK_fno foreign key references yg(ygbh)
)
go
9.create table zixx
( spbh char(8) not null
constraint FK_gno foreign key references sp(spbh),
sl int not null,
dj money not null,
zkbl char(10) not null,
je money not null,
)
go
10.create table kc
(kcxxbh char(8) not null
constraint PK_pno primary key,
spbh char(8) not null
constraint FK_ino foreign key references sp(spbh),
kcl int not null
)
go
五、数据库扩展功能实现
1.CREATE TRIGGER triger_sl
ON rk
after insert
AS
update kc
set kcl=kcl+(select sl from inserted)
where spbh=(select spbh from inserted)
2. CREATE TRIGGER triger_kc
ON zixx
after delete
AS
update kc
set kcl=kcl-(select sl from deleted) where spbh=(select spbh from deleted)
正在阅读:
超市pos系统的数据库设计.doc05-04
技师专业技术工作总结(精选多篇)09-28
《现代诗歌阅读》03-15
道桥毕业设计开题报告05-20
酒店管理系统报告02-27
反洗钱工作实施方案06-05
八年级物理(上册)易错题12-31
寿险公司内部控制评估表 - 法人机构11-29
用爱心培养心灵的成长11-07
特教课《放小鸟》(说课稿)11-01
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- 超市
- 数据库
- 设计
- 系统
- pos
- doc
- 学生体育运动联盟组织下的活动课新模式探究-最新教育文档
- 赵宗元毛中特强化复习必备考点含答案-第十三章
- 2018年高考语文真题分类汇编专题04:语言简明、表达得体、仿写
- 海龟汤题目网络搜集版
- 2018年安徽师范大学化学与材料科学学院333教育综合之简明中国教育史考研强化五套模拟题
- 为什么钓点之间要有适当的距离
- 河南省殡葬管理暂行办法.doc
- 小学语文教师个人述职报告模板5篇
- 地砖铺贴施工工艺和技术标准
- XX区人力资源服务产业园管理办法(试行)
- SIMATIC 过程控制系统 PCS 7 时间同步V7.0
- 电力设备公司技术员个人工作小结
- 2018届高考生物一轮复习加练半小时 第12练
- 读夏洛的网有感600字精选范文
- 电缆制作通用工艺规范
- 八年级物理上册 第四章 第三节 科学探究:平面镜成像(第1课时 探究平面镜成像特点)练习 教科版
- 开一家干洗店如何节约成本
- 2014-2015学年河北省石家庄市栾城县七年级上学期数学期末试卷带答案
- 2019年三年级上册信息技术教案-第7课 特殊符号 标点符号和数字的输入新疆版-文档资料
- 2020年吉林省延边朝鲜族自治州和龙市《公共理论》教师招聘真题库及答案