供应链管理系统的数据库设计

上传人:桔**** 文档编号:512042629 上传时间:2023-03-14 格式:DOCX 页数:22 大小:287.74KB
返回 下载 相关 举报
供应链管理系统的数据库设计_第1页
第1页 / 共22页
供应链管理系统的数据库设计_第2页
第2页 / 共22页
供应链管理系统的数据库设计_第3页
第3页 / 共22页
供应链管理系统的数据库设计_第4页
第4页 / 共22页
供应链管理系统的数据库设计_第5页
第5页 / 共22页
点击查看更多>>
资源描述

《供应链管理系统的数据库设计》由会员分享,可在线阅读,更多相关《供应链管理系统的数据库设计(22页珍藏版)》请在金锄头文库上搜索。

1、供应链管理系统的数据库设计1. 系统需求分析a. 通过建立供应链的数据库建立以方便各种信息的查询与管理工 作。b. 系统简述:本系统包括六个实体:生产商;运输商;商场;仓库;商品;顾客 包括四个关系转为四个表:运输;生产;销售;储存。c. 对该数据库进行如下数据处理:I查询:查询其商场所有的信息,输入商场编号,输出信息 查询某种商品的生产、运输、商场的信息,输入商品 的编号,输出生产商、运输时间、运输商、销售商场 商场想查询某一类的商品储存仓库信息,输入商品编 号,输出仓库编号地址、储存时间 查询商品列表里的各类商品个数,并按类型分组。II.插入:在商品表中插入新商品 插入新的销售记录 插入新

2、的运输记录m.修改:修改旧商品的价格 修改运输的记录二. 系统概念模型(E-R图) 实体的关系图:实体的属性图:关系属性图:三、关系模式(加下划线的是主键) 生产商关系:(生产商编号,生产商名称,生产商地址,生产商类型, 生产商注册年份) 运输商关系:(运输商编号,运输商名称,运输商注册年份,运输商地 址,运输商车辆数) 商场关系:(商场编号,商场名称,商场注册年份,商场地址,商场规 模) 顾客关系:(顾客身份证号,顾客姓名,顾客年龄,顾客性别) 仓库关系:(仓库编号,仓库地址,仓库存储价格) 商品关系:(商品编号,商品名称,商品价格,商品类型) 生产关系:(生产编号,商品编号,生产商编号,生

3、产时间) 运输关系:(运输编号,商场编号,生产商编号,商品编号,运输时间, 运输商编号) 销售关系:(顾客身份证号,商场编号,商品编号,销售编号,销售时 间) 储存关系:(储存编号,商品编号,仓库编号,储存时间,所属商场)四、物理设计生产商:字段名类型特殊属性生产商编号char(20)主键生产商名称char(20)not null生产商地址char(20)not null生产商类型char(20)生产商注册年份datetimenot null运输商:字段名类型特殊属性运输商编号char(20)主键运输商名称char(10)not null运输商注册年份datetimenot null运输商地址

4、char(20)not null运输商车辆数intnot null 商场:字段名类型特殊属性商场编号char(20)主键商场名称char(10)not null商场注册年份datetimenot null商场地址char(20)not null商场规模char(20)not null 顾客:商品:字段名类型特殊属性字段名类型特殊属性字段名类型特殊属性顾客身份证号char(20)主键顾客姓名char(10)not null顾客性别char(2)not null顾客年龄intnot null仓库字段名类型特殊属性仓库编号char(20)主键仓库地址char(10)not null仓库存储价格mon

5、eynot null商品编号char(20)主键商品名称char(10)not null商品类型char(20)not null商品价格moneynot null 生产:字段名类型特殊属性生产编号char(20)主键生产商编号char(10)外键商品编号char(20)not null生产时间datetimenot null 运输:字段名类型特殊属性运输编号char(20)主键运输商编号char(10)外键商场编号Char (20)nut null商品编号char(20)not null生产商编号char(20)not null运输时间datetime 销售:字段名类型特殊属性销售编号Char

6、(10)主键商场编号char(10)not null销售时间char(20)not null商品编号char(20)外键顾客身份证号char(20)not null 储存:字段名类型特殊属性储存编号char(20)主键仓库编号char(10)外键商品编号Char(20)not null储存时间char(20)not null所属商场char(20)not null五、系统实现1.数据库与其基本表的建立数据库的建立用企业管理器,基本表用T-SQL语言:数据库名:PM-System建立数据库的T-SQL语句如下:Create database PM-SystemOn(name=pm_system_

7、data,E:数据库 sm_system_data.mdf )Log on(name=pm_system_log, E: 数据库sm_system_data.ldf )建立表的SQL语句如下:Use PM_SystemCreate table 生产商(生产商编号 char(20) primary key,生产商名称 char(20) not null,生产商地址 char(20) not null,生产商类型char(20),生产商注册年份datetime not null)Create table 运输商(运输商编号 char(20) primary key,运输商名称 char(10) n

8、ot null,运输商注册年份datetime not null,运输商地址 char(20) not null,运输商车辆数int not null)Create table 商场(商场编号 char(20) primary key,商场名称 char(10) not null,商场地址 char(20) not null,商场注册年份 datetime not null,商场规模char(20) not null)Create table 顾客(顾客身份证号 char(20) primary key,顾客姓名char(10) not null,顾客年龄int,顾客性别 char(2) no

9、t null)Create table 仓库(仓库编号 char(20) primary key,仓库地址char(10) not null,仓库存储价格money not null)Create table 商品(商品编号 char(20) primary key,商品名称 char(10) not null,商品价格 money not null,商品类型 char(20) not null)Create table 生产(生产编号 char(20) primary key,商品编号 char(20) not null,生产商编号 char(20) not null references生

10、产商(生产商编号),生产时间 datetime not null)Create table 运输(运输编号 char(20) primary key,商场编号 Char(20) nut null,生产商编号char(20)not null,商品编号char(20)not null,运输时间datetime,运输商编号char(20)not null references运输商(运输商编号))Create table 销售(顾客身份证号char(20) not null,商场编号 char(20) not null,商品编号char(20) not null references商品(商品编号)

11、,销售编号Char(10) primary key,销售时间 char(20) not null)Create table 存储(储存编号 char(20) pimary key,商品编号 Char(20) not null,仓库编号 char(20) not null references仓库(仓库编号),储存时间 char(20) not null,所属商场char(20) not null)输入数据:Insert into 生产商 values(0001, 可口可乐,北京,食 品 ,2010.01.01)Insert into 生产商 values(0002, 百事可乐,天津,食 品 ,

12、2010.01.02)Insert into 生产商 values(0003,ADIDAS 运动鞋,北京, 鞋帽 ,2010.02.01)Insert into 生产商 values(0004,Audi A4, 北京,汽 车 ,2010.03.01)Insert into 生产商 values(0005, 麦当劳,北京,食 品 ,2010.04.01)Insert into 运输 values(0001, 运一,2009.09.01, 北 京,10)Insert into 运输 values(0002, 运二,2010.01.01,J匕 京,20)Insert into 运输 values(0

13、003, 运三,2010.02.02, 天 津,30)Insert into 运输 values(0004, 运四 ,2009.09.01, 天 津 ,40)Insert into 运输 values(0005, 运五,1997.01.02, 上 海,20)Insert into 商场 values(0001, 商场一,天 津 2009.01.01, 大)Insert into 商场 values(0002, 商场二,匕 京 2010.01.01, 小)Insert int o 商场 values(0003, 商场三,上海2010.02.02, 小)Insert int o 商场 values(0004, 商场四,长沙 2010.03.01, 大)Insert into 仓库 values(00

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号