超市POS管理系统

给你一个完整的项目的设计,你参考一下:


超市POS管理系统

数据库设计
数据库在一个信息管理系统中占有非常重要的地位,数据库结构的设计好坏将直接对应用系统的效率以及实现的效果产生影响。 数据库设计 一般包括以下四个部分:数据库需求分析、数据库概念结构设计、数据库逻辑结构设计、数据库物理结构实现。
一、数据库需求分析
通过对超市管理工作过程的内容和数据流图分析,设计如下面的数据项和数据结构。
1、员工信息,包括的数据项有:员工编号,姓名,性别,职务,口令,权限级别、身份证号,所属部门编号等。
2、部门信息,包括的数据项有:部门编号,部门名称。
3、供应商信息,包括的数据项有:供应商编号,供应商名称,地址,邮政编码,电话号码,税号,银行帐号,开户银行,联系人,备注等。
4、会员信息,包括的数据项有:会员编号,姓名,性别,身份证号,消费总金额,积分等。
5、入库信息,包括的数据项有:入库编号,入库日期,商品编号,计量单位,入库价格,销售价格,数量,总金额,供应商编号,业务员编号等。
6、商品信息,包括的数据项有:商品编号,所属类别,数量,单价,商品名称等。
7、销售出货单主信息,包括的数据项有:销售日期,总金额,是否现金,是否会员,会员编号、收银号编号等。
8、销售出货单子信息,包括的数据项有:商品编号,数量,单价,折扣比例,金额等。


SQL code
   
   
数据库逻辑结构设计 员工信息表 字段名 数据类型 长度 说明 描述 Ygbh Char 8 不空,主键 员工编号 Name Char 8 不空 姓名 Sex Char 2 不空‘男’、‘女’ 性别 Zw Char 10 不空 职务 Kl varChar 20 不空 口令 Qxjb Char 1 不空 权限级别 Sfzh Char 18 不空,唯一约束 身份证号 ssbmbh char 4 不空,外键 所属部门编号 商品信息 字段名 数据类型 长度 说明 描述 Spbh char 8 不空,主键 商品编号 Spmc varchar 20 不空 商品名称 Sslb char 8 不空 所属类别 Jg money 8 不空 价格 sl int 4 不空 数量 部门信息表 字段名 数据类型 长度 说明 描述 bmbh char 8 不空,主键 部门编号 bmmc char 4 不空 部门名称 供应商信息表 字段名 数据类型 长度 说明 描述 Gysbh Char 8 不空,主键 供应商编号 Gysmc Char 8 不空 供应商名称 Dz varChar 20 不空 地址 Yzbm Char 6 不空 邮政编码 Dhhm varchar 15 不空 电话号码 Sh varChar 3 不空 税号 Yhzh varChar 20 不空 银行帐号 Khyh Char 8 不空 开户银行 Lxr Char 8 不空 联系人 beizhu text 16 备注 会员信息表 字段名 数据类型 长度 说明 描述 Hybh Char 8 不空,主键 会员编号 Name Char 6 不空 姓名 Sex Char 2 不空,’男’、’女’ 性别 Sfzh varChar 20 不空 身份证号 xfzje money 8 不空 消费总金额 jf int 4 不空 积分 入库信息表 字段名 数据类型 长度 说明 描述 Rkbh char 8 不空,主键 入库编号 Rkrq Datetime 8 不空 入库日期 Spbh char 8 不空,外键 商品编号 Jldw Char 2 不空 计量单位 Rkjg Money 8 不空 入库价格 Xsjg Money 8 不空 销售价格 Sl int 4 不空 数量 Zje Money 8 不空 总金额 Gysbh char 8 不空,外键 供应商编号 ywybh char 8 不空,外键 业务员编号 库存信息表 字段名 数据类型 长度 说明 描述 kcxxbh char 8 不空,主键 库存信息编号 Spbh char 8 不空,外键 商品编号 kcl int 4 不空 库存量 销售出货单主信息 字段名 数据类型 长度 说明 描述 Xsrq datetime 8 不空 销售日期 Zje Money 8 不空 总金额 Sfxj Char 2 不空 是否现金 Sfhy char 2 可为空 是否会员 Hybh Char 8 不空,外键 会员编号 Syybh char 8 不空,外键 收银号编号 销售出货单子信息 字段名 数据类型 长度 说明 描述 Spbh char 8 不空,外键 商品编号 Sl int 4 不空 数量 Dj money 8 不空 单价 Zkbl char 10 不空 折扣比例 Je money 8 不空 金额 四、数据库物理结构实现 根据以上的逻辑分析所得到表的关系,我们使用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 -- ER图部分我省略了,贴不上来
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值