《管理信息系统》实验报告
图书销售管理系统
系统分析与设计
班级 109080702 学号 03 姓名 董崇德 教师 成 卫
2011年11月6日
实验二 图书销售管理的系统分析(一)——业务流程调查
一、实验目的:掌握组织结构和管理业务流程调查的方法及其成果的绘制。
二、建议机时:4机时(课内2机时,课外2机时) 三、实验内容
1、熟悉系统分析工具Visio的应用环境;
2、掌握组织结构调查的方法并利用Visio绘制组织结构图; 3、掌握管理业务流程调查的方法并利用Visio绘制业务流程图。 四、实验步骤
1、 需求调查
在书店的日常管理中,书籍的进销存管理是书店的一项非常重要的工作。书店管理人员需要及时了解各种书籍的入库情况、销售情况和库存情况,以便更好地分析各类书籍的走势,合理安排书店经营的各个环节,尽可能扩大书店的营业量。因此,建立图书进销存管理系统成为企业信息化建设及现代化管理的必由之路。
2、 图书销售管理组织结构及信息化状况调查
经过调查发现:该书店的图书经营部是由采购科、销售科、客户服务中心和库房四个科室组成,采购科主要负责书籍的订购与采购;销售科负责书籍的销售、缺货登记处理及销售统计分析;客户服务中心负责客户资料的建立和维护、大客户关系协调;库房负责书籍的入库、出库和盘点工作。
【根据以上调查文字,再在下面给出该书店的组织结构图】
3、 图书销售管理业务流程调查:
采购科查询书籍的库存信息和读者的需求信息,若书籍库存量不能满足用户的需要,则编制书籍采购订货单,并交送给供货商,进行书籍的采购;供货商按订货单要求发货,并将收货单提交给库房检验员;库房检验员对收到的书籍进行检验,如发现书籍不合格,直接将书籍退回给供货商,如果产品合格,则开出入库单,提交给库房主管,由库房主管进行入库审核处理;如果审核合格,则进行产品入库并登记流水账及修改库存信息,如果不合格,则开出退货单,将书籍退回给供货商。
【根据以上业务调查文字,再在下面给出业务流程图】
实验三 图书销售管理的系统分析(二)——数据流程调查
一、实验目的:掌握数据流程分析的方法和数据流程图的分层次绘制及其数据字典的建立 二、建议机时:8机时(课内4机时,课外4机时) 三、实验内容
1、掌握数据流程调查和分析的方法;
2、利用Visio绘制数据流程图并在绘制的过程中建立标准、统一的编码; 3、根据数据流程图建立相应的数据字典。 四、实验步骤
1、 数据流程图的层次绘制方法复习
数据流程图分层次绘制模型:
数据流程图是按照“自顶向下、逐层细化”的原则进行,在绘制整个数据流程图的过程中,一定要建立标准、统一的编码,并建立相应的数据字典。
2 、根据实验二完成的图书销售管理业务的业务流程图,按照业务流程到数据流程的转换规则,完成图书销售管理系统数据流程图的绘制。
【在此给出完整的数据流程图】
3、编写相应的正确的数据字典
表3-3 数据存储的描述
表3-4 外部实体的描述
实验四 系统分析(三)-------新系统概念模型的建立
一、实验目的:掌握新系统概念模型(E-R图)分析和绘制方法
二、建议机时:4机时(课内2机时,课外2机时) 三、实验内容
1、掌握概念模型的作用;
2、掌握新系统概念模型的分析方法;
3、利用Visio绘制新系统的概念模型图(E-R图); 4、学会绘制局部和整体E-R图。 四、实验步骤
根据对图书销售管理系统调查分析的结果,建立该系统概念模型的相关文字材料整理如下:
该销售部门对图书进行记录时要涉及到图书作者和出版社,图书作者要记录其姓名、性别、出生日期、简介,并对其编号;出版社要记录其名称、地址、邮政编码、负责人、备注,并对其编号;对图书要记录其书名、版本、定价、出版日期,并对其编号。图书到货时先入库,一个库房可存放多批图书,一批图书可存放在多个库房,存放时要注明入库日期和库存数量;对库房要记录其编号和名称。图书由采购人员向供货单位进行采购;采购人员和管理人员一样要记录其编号、姓名、性别、联系电话;对供货单位要记录其编号、名称、地址、联系电话;在采购的时候要注明采购的价格,它和书籍的入库价格是一致的。图书可有管理人员或售书员进行销售,销售时要记录销售时间、销售数量、销售价格;顾客找不到想要的书籍或者需求量超过库存数时,可将其需求进行登记;登记时要注明需求日期和需求数量;此外要记录顾客的编号、姓名、性别、读书爱好、购书次数、存档日期等信息。
【请根据以上信息,绘制图书销售管理系统的概念模型图(E-R图)】
供货单位(编号,名称,地址,联系电话)
库存(入库数量,入库日
期,
图书(书名,价格,出版日
期,版本)
采购(编号,采购价格,
实验六 系统设计(二)——数据库设计
一、实验目的: 建立新系统的逻辑模型并在PB/VF环境下创建数据库
二、建议机时:4机时(课内2机时,课外2机时) 三、实验内容
1、掌握根据E-R图进行逻辑模型转换的规则; 2、熟悉Power_ Designer(S_ Designer)的使用;
3、根据系统概念模型的设计结果,利用Power_ Designer(S_ Designer)建立CDM
图;
4、在Power_ Designer(S_ Designer)环境下,把得到的CDM图正确转换成PDM图;
5、根据得到的新系统逻辑模型图,在PB环境下正确创建新系统的数据库。 四、实验步骤
根据对图书销售管理系统调查分析的结果,建立该系统数据模型的相关文字材料整理如下:
该销售部门对图书进行记录时要涉及到图书作者和出版社,图书作者要记录其姓名、性别、出生日期、简介,并对其编号;出版社要记录其名称、地址、邮政编码、负责人、备注,并对其编号;对图书要记录其书名、版本、定价、出版日期,并对其编号。图书到货时先入库,一个库房可存放多批图书,一批图书可存放在多个库房,存放时要注明入库日期和库存数量;对库房要记录其编号和名称。图书由采购人员向供货单位进行采购;采购人员和管理人员一样要记录其编号、姓名、性别、联系电话;对供货单位要记录其编号、名称、地址、联系电话;在采购的时候要注明采购的价格,它和书籍的入库价格是一致的。图书可有管理人员或售书员进行销售,销售时要记录销售时间、销售数量、销售价格;顾客找不到想要的书籍或者需求量超过库存数时,可将其需求进行登记;登记时要注明需求日期和需求数量;此外要记录顾客的编号、姓名、性别、读书爱好、购书次数、存档日期等信息。
【请根据以上信息,结合实验四的E-R模型结果,利用S_ Designer数据库设计工具,设计出本数据库的CDM、PDM和数据库脚本】
/*==============================================================*/
/* DBMS name: Sybase SQL Anywhere 10 */
/* Created on: 2011-11-2 17:29:51 */
/*==============================================================*/
if exists(select 1 from sys.sysforeignkey where role='FK_CG_CG_TUSHU') then alter table CG
delete foreign key FK_CG_CG_TUSHU end if;
if exists(select 1 from sys.sysforeignkey where role='FK_CG_CG2_GHDW') then alter table CG
delete foreign key FK_CG_CG2_GHDW end if;
if exists(select 1 from sys.sysforeignkey where role='FK_CZ_CZ_TSZZ') then
alter table CZ
delete foreign key FK_CZ_CZ_TSZZ
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_CZ_CZ2_TUSHU') then alter table CZ
delete foreign key FK_CZ_CZ2_TUSHU
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_GM_GM_TUSHU') then alter table GM
delete foreign key FK_GM_GM_TUSHU
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_GM_GM2_GK') then alter table GM
delete foreign key FK_GM_GM2_GK
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_RK_RK_TUSHU') then alter table RK
delete foreign key FK_RK_RK_TUSHU
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_RK_RK2_KF') then
alter table RK
delete foreign key FK_RK_RK2_KF
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_TUSHU_出版_CBS') then alter table TUSHU
delete foreign key FK_TUSHU_出版_CBS
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CBS_PK'
and t.table_name='CBS'
drop index CBS.CBS_PK
end if;
if exists(
select 1 from sys.systable
where table_name='CBS'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table CBS
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CG2_FK'
and t.table_name='CG'
) then
drop index CG.CG2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CG_FK'
and t.table_name='CG'
) then
drop index CG.CG_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CG_PK'
and t.table_name='CG'
) then
drop index CG.CG_PK
end if;
select 1 from sys.systable
where table_name='CG'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table CG
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CZ2_FK'
and t.table_name='CZ'
) then
drop index CZ.CZ2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CZ_FK'
and t.table_name='CZ'
) then
drop index CZ.CZ_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CZ_PK'
and t.table_name='CZ'
) then
drop index CZ.CZ_PK
end if;
if exists(
select 1 from sys.systable
where table_name='CZ'
and table_type in ('BASE', 'GBL TEMP')
drop table CZ
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GHDW_PK'
and t.table_name='GHDW'
) then
drop index GHDW.GHDW_PK
end if;
if exists(
select 1 from sys.systable
where table_name='GHDW'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table GHDW
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GK_PK'
and t.table_name='GK'
) then
drop index GK.GK_PK
end if;
if exists(
select 1 from sys.systable
where table_name='GK'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table GK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GM2_FK'
and t.table_name='GM'
) then
drop index GM.GM2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GM_FK'
and t.table_name='GM'
) then
drop index GM.GM_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GM_PK'
and t.table_name='GM'
) then
drop index GM.GM_PK
end if;
if exists(
select 1 from sys.systable
where table_name='GM'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table GM
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='KF_PK'
and t.table_name='KF'
drop index KF.KF_PK
end if;
if exists(
select 1 from sys.systable
where table_name='KF'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table KF
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='RK2_FK'
and t.table_name='RK'
) then
drop index RK.RK2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='RK_FK'
and t.table_name='RK'
) then
drop index RK.RK_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='RK_PK'
and t.table_name='RK'
) then
drop index RK.RK_PK
end if;
select 1 from sys.systable
where table_name='RK'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table RK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='TSZZ_PK'
and t.table_name='TSZZ'
) then
drop index TSZZ.TSZZ_PK
end if;
if exists(
select 1 from sys.systable
where table_name='TSZZ'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table TSZZ
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='出版_FK'
and t.table_name='TUSHU'
) then
drop index TUSHU.出版_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='TUSHU_PK'
and t.table_name='TUSHU'
drop index TUSHU.TUSHU_PK
end if;
if exists(
select 1 from sys.systable
where table_name='TUSHU'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table TUSHU
end if;
/*==============================================================*/
/* Table: CBS */
/*==============================================================*/
create table CBS
(
CBSBH numeric(1111) not null,
BZ char(1111),
FZR char(1111),
YZBH numeric(1111),
DZ char(1111),
CBSMC char(1111),
constraint PK_CBS primary key (CBSBH)
);
/*==============================================================*/
/* Index: CBS_PK */
/*==============================================================*/
create unique index CBS_PK on CBS (
CBSBH ASC
);
/*==============================================================*/
/* Table: CG */
/*==============================================================*/
create table CG
(
TSBH numeric(1111) not null,
GHDWBH char(1111) not null,
CGJG money,
constraint PK_CG primary key clustered (TSBH, GHDWBH)
);
/*==============================================================*/
/* Index: CG_PK */
/*==============================================================*/
create unique clustered index CG_PK on CG (
TSBH ASC,
GHDWBH ASC
);
/*==============================================================*/
/* Index: CG_FK */
/*==============================================================*/
create index CG_FK on CG (
TSBH ASC
);
/*==============================================================*/
/* Index: CG2_FK */
/*==============================================================*/
create index CG2_FK on CG (
GHDWBH ASC
);
/*==============================================================*/
/* Table: CZ */
/*==============================================================*/
create table CZ
(
ZZBH numeric(1111) not null,
TSBH numeric(1111) not null,
constraint PK_CZ primary key clustered (ZZBH, TSBH)
);
/*==============================================================*/
/* Index: CZ_PK */
/*==============================================================*/
create unique clustered index CZ_PK on CZ (
ZZBH ASC,
TSBH ASC
);
/*==============================================================*/
/* Index: CZ_FK */
/*==============================================================*/
create index CZ_FK on CZ (
ZZBH ASC
);
/*==============================================================*/
/* Index: CZ2_FK */
/*==============================================================*/
create index CZ2_FK on CZ (
TSBH ASC
);
/*==============================================================*/
/* Table: GHDW */
/*==============================================================*/
create table GHDW
(
GHDWBH char(1111) not null,
GHDWMC char(1111),
GHDWDZ char(1111),
GHDWLXDH numeric(1111),
Attribute_24 char(10),
constraint PK_GHDW primary key (GHDWBH)
);
/*==============================================================*/
/* Index: GHDW_PK */
/*==============================================================*/
create unique index GHDW_PK on GHDW (
GHDWBH ASC
);
/*==============================================================*/
/* Table: GK */
/*==============================================================*/
create table GK
(
GKBH numeric(1111) not null,
ZDRQ timestamp,
GSCS numeric(1111),
DSAH char(1111),
GKXB varchar(1111),
GKXM char(1111),
constraint PK_GK primary key (GKBH)
/*==============================================================*/
/* Index: GK_PK */
/*==============================================================*/
create unique index GK_PK on GK (
GKBH ASC
);
/*==============================================================*/
/* Table: GM */
/*==============================================================*/
create table GM
(
TSBH numeric(1111) not null,
GKBH numeric(1111) not null,
XSSJ datetime,
XSSL money,
XSJG money,
constraint PK_GM primary key clustered (TSBH, GKBH)
);
/*==============================================================*/
/* Index: GM_PK */
/*==============================================================*/
create unique clustered index GM_PK on GM (
TSBH ASC,
GKBH ASC
);
/*==============================================================*/
/* Index: GM_FK */
/*==============================================================*/
create index GM_FK on GM (
TSBH ASC
);
/*==============================================================*/
/* Index: GM2_FK */
/*==============================================================*/
create index GM2_FK on GM (
GKBH ASC
);
/*==============================================================*/
/* Table: KF */
/*==============================================================*/
create table KF
(
KFBH numeric(1111) not null,
KFMC char(1111),
Attribute_19 char(10),
constraint PK_KF primary key (KFBH)
);
/*==============================================================*/
/* Index: KF_PK */
/*==============================================================*/
create unique index KF_PK on KF (
KFBH ASC
);
/*==============================================================*/
/* Table: RK */
/*==============================================================*/
create table RK
(
TSBH numeric(1111) not null,
KFBH numeric(1111) not null,
RKSL money,
RKRQ datetime,
constraint PK_RK primary key clustered (TSBH, KFBH)
);
/*==============================================================*/
/* Index: RK_PK */
/*==============================================================*/
create unique clustered index RK_PK on RK (
TSBH ASC,
KFBH ASC
);
/*==============================================================*/
/* Index: RK_FK */
/*==============================================================*/
create index RK_FK on RK (
TSBH ASC
);
/*==============================================================*/
/* Index: RK2_FK */
/*==============================================================*/
create index RK2_FK on RK (
KFBH ASC
);
/*==============================================================*/
/* Table: TSZZ */
/*==============================================================*/
create table TSZZ
(
ZZBH numeric(1111) not null,
XINGMING char(1111),
XINGBIE varchar(1111),
CSRQ date,
JJ char(1111),
constraint PK_TSZZ primary key (ZZBH)
);
/*==============================================================*/
/* Index: TSZZ_PK */
/*==============================================================*/
create unique index TSZZ_PK on TSZZ (
ZZBH ASC
);
/*==============================================================*/
/* Table: TUSHU */
/*==============================================================*/
create table TUSHU
(
TSBH numeric(1111) not null,
CBSBH numeric(1111),
SHUMING char(1111),
CBRQ date,
BANBEN varchar(1111),
JIAGE numeric(1111),
constraint PK_TUSHU primary key (TSBH)
/*==============================================================*/
/* Index: TUSHU_PK */
/*==============================================================*/
create unique index TUSHU_PK on TUSHU (
TSBH ASC
);
/*==============================================================*/
/* Index: 出版_FK */
/*==============================================================*/
create index 出版_FK on TUSHU (
CBSBH ASC
);
alter table CG
add constraint FK_CG_CG_TUSHU foreign key (TSBH)
references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table CG
add constraint FK_CG_CG2_GHDW foreign key (GHDWBH)
references GHDW (GHDWBH)
on update restrict
on delete restrict;
alter table CZ
add constraint FK_CZ_CZ_TSZZ foreign key (ZZBH)
references TSZZ (ZZBH)
on update restrict
on delete restrict;
alter table CZ
add constraint FK_CZ_CZ2_TUSHU foreign key (TSBH) references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table GM
add constraint FK_GM_GM_TUSHU foreign key (TSBH) references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table GM
add constraint FK_GM_GM2_GK foreign key (GKBH) references GK (GKBH)
on update restrict
on delete restrict;
alter table RK
add constraint FK_RK_RK_TUSHU foreign key (TSBH) references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table RK
add constraint FK_RK_RK2_KF foreign key (KFBH) references KF (KFBH)
on update restrict
on delete restrict;
alter table TUSHU
add constraint FK_TUSHU_出版_CBS foreign key (CBSBH) references CBS (CBSBH)
on update restrict
on delete restrict;
《管理信息系统》实验报告
图书销售管理系统
系统分析与设计
班级 109080702 学号 03 姓名 董崇德 教师 成 卫
2011年11月6日
实验二 图书销售管理的系统分析(一)——业务流程调查
一、实验目的:掌握组织结构和管理业务流程调查的方法及其成果的绘制。
二、建议机时:4机时(课内2机时,课外2机时) 三、实验内容
1、熟悉系统分析工具Visio的应用环境;
2、掌握组织结构调查的方法并利用Visio绘制组织结构图; 3、掌握管理业务流程调查的方法并利用Visio绘制业务流程图。 四、实验步骤
1、 需求调查
在书店的日常管理中,书籍的进销存管理是书店的一项非常重要的工作。书店管理人员需要及时了解各种书籍的入库情况、销售情况和库存情况,以便更好地分析各类书籍的走势,合理安排书店经营的各个环节,尽可能扩大书店的营业量。因此,建立图书进销存管理系统成为企业信息化建设及现代化管理的必由之路。
2、 图书销售管理组织结构及信息化状况调查
经过调查发现:该书店的图书经营部是由采购科、销售科、客户服务中心和库房四个科室组成,采购科主要负责书籍的订购与采购;销售科负责书籍的销售、缺货登记处理及销售统计分析;客户服务中心负责客户资料的建立和维护、大客户关系协调;库房负责书籍的入库、出库和盘点工作。
【根据以上调查文字,再在下面给出该书店的组织结构图】
3、 图书销售管理业务流程调查:
采购科查询书籍的库存信息和读者的需求信息,若书籍库存量不能满足用户的需要,则编制书籍采购订货单,并交送给供货商,进行书籍的采购;供货商按订货单要求发货,并将收货单提交给库房检验员;库房检验员对收到的书籍进行检验,如发现书籍不合格,直接将书籍退回给供货商,如果产品合格,则开出入库单,提交给库房主管,由库房主管进行入库审核处理;如果审核合格,则进行产品入库并登记流水账及修改库存信息,如果不合格,则开出退货单,将书籍退回给供货商。
【根据以上业务调查文字,再在下面给出业务流程图】
实验三 图书销售管理的系统分析(二)——数据流程调查
一、实验目的:掌握数据流程分析的方法和数据流程图的分层次绘制及其数据字典的建立 二、建议机时:8机时(课内4机时,课外4机时) 三、实验内容
1、掌握数据流程调查和分析的方法;
2、利用Visio绘制数据流程图并在绘制的过程中建立标准、统一的编码; 3、根据数据流程图建立相应的数据字典。 四、实验步骤
1、 数据流程图的层次绘制方法复习
数据流程图分层次绘制模型:
数据流程图是按照“自顶向下、逐层细化”的原则进行,在绘制整个数据流程图的过程中,一定要建立标准、统一的编码,并建立相应的数据字典。
2 、根据实验二完成的图书销售管理业务的业务流程图,按照业务流程到数据流程的转换规则,完成图书销售管理系统数据流程图的绘制。
【在此给出完整的数据流程图】
3、编写相应的正确的数据字典
表3-3 数据存储的描述
表3-4 外部实体的描述
实验四 系统分析(三)-------新系统概念模型的建立
一、实验目的:掌握新系统概念模型(E-R图)分析和绘制方法
二、建议机时:4机时(课内2机时,课外2机时) 三、实验内容
1、掌握概念模型的作用;
2、掌握新系统概念模型的分析方法;
3、利用Visio绘制新系统的概念模型图(E-R图); 4、学会绘制局部和整体E-R图。 四、实验步骤
根据对图书销售管理系统调查分析的结果,建立该系统概念模型的相关文字材料整理如下:
该销售部门对图书进行记录时要涉及到图书作者和出版社,图书作者要记录其姓名、性别、出生日期、简介,并对其编号;出版社要记录其名称、地址、邮政编码、负责人、备注,并对其编号;对图书要记录其书名、版本、定价、出版日期,并对其编号。图书到货时先入库,一个库房可存放多批图书,一批图书可存放在多个库房,存放时要注明入库日期和库存数量;对库房要记录其编号和名称。图书由采购人员向供货单位进行采购;采购人员和管理人员一样要记录其编号、姓名、性别、联系电话;对供货单位要记录其编号、名称、地址、联系电话;在采购的时候要注明采购的价格,它和书籍的入库价格是一致的。图书可有管理人员或售书员进行销售,销售时要记录销售时间、销售数量、销售价格;顾客找不到想要的书籍或者需求量超过库存数时,可将其需求进行登记;登记时要注明需求日期和需求数量;此外要记录顾客的编号、姓名、性别、读书爱好、购书次数、存档日期等信息。
【请根据以上信息,绘制图书销售管理系统的概念模型图(E-R图)】
供货单位(编号,名称,地址,联系电话)
库存(入库数量,入库日
期,
图书(书名,价格,出版日
期,版本)
采购(编号,采购价格,
实验六 系统设计(二)——数据库设计
一、实验目的: 建立新系统的逻辑模型并在PB/VF环境下创建数据库
二、建议机时:4机时(课内2机时,课外2机时) 三、实验内容
1、掌握根据E-R图进行逻辑模型转换的规则; 2、熟悉Power_ Designer(S_ Designer)的使用;
3、根据系统概念模型的设计结果,利用Power_ Designer(S_ Designer)建立CDM
图;
4、在Power_ Designer(S_ Designer)环境下,把得到的CDM图正确转换成PDM图;
5、根据得到的新系统逻辑模型图,在PB环境下正确创建新系统的数据库。 四、实验步骤
根据对图书销售管理系统调查分析的结果,建立该系统数据模型的相关文字材料整理如下:
该销售部门对图书进行记录时要涉及到图书作者和出版社,图书作者要记录其姓名、性别、出生日期、简介,并对其编号;出版社要记录其名称、地址、邮政编码、负责人、备注,并对其编号;对图书要记录其书名、版本、定价、出版日期,并对其编号。图书到货时先入库,一个库房可存放多批图书,一批图书可存放在多个库房,存放时要注明入库日期和库存数量;对库房要记录其编号和名称。图书由采购人员向供货单位进行采购;采购人员和管理人员一样要记录其编号、姓名、性别、联系电话;对供货单位要记录其编号、名称、地址、联系电话;在采购的时候要注明采购的价格,它和书籍的入库价格是一致的。图书可有管理人员或售书员进行销售,销售时要记录销售时间、销售数量、销售价格;顾客找不到想要的书籍或者需求量超过库存数时,可将其需求进行登记;登记时要注明需求日期和需求数量;此外要记录顾客的编号、姓名、性别、读书爱好、购书次数、存档日期等信息。
【请根据以上信息,结合实验四的E-R模型结果,利用S_ Designer数据库设计工具,设计出本数据库的CDM、PDM和数据库脚本】
/*==============================================================*/
/* DBMS name: Sybase SQL Anywhere 10 */
/* Created on: 2011-11-2 17:29:51 */
/*==============================================================*/
if exists(select 1 from sys.sysforeignkey where role='FK_CG_CG_TUSHU') then alter table CG
delete foreign key FK_CG_CG_TUSHU end if;
if exists(select 1 from sys.sysforeignkey where role='FK_CG_CG2_GHDW') then alter table CG
delete foreign key FK_CG_CG2_GHDW end if;
if exists(select 1 from sys.sysforeignkey where role='FK_CZ_CZ_TSZZ') then
alter table CZ
delete foreign key FK_CZ_CZ_TSZZ
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_CZ_CZ2_TUSHU') then alter table CZ
delete foreign key FK_CZ_CZ2_TUSHU
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_GM_GM_TUSHU') then alter table GM
delete foreign key FK_GM_GM_TUSHU
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_GM_GM2_GK') then alter table GM
delete foreign key FK_GM_GM2_GK
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_RK_RK_TUSHU') then alter table RK
delete foreign key FK_RK_RK_TUSHU
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_RK_RK2_KF') then
alter table RK
delete foreign key FK_RK_RK2_KF
end if;
if exists(select 1 from sys.sysforeignkey where role='FK_TUSHU_出版_CBS') then alter table TUSHU
delete foreign key FK_TUSHU_出版_CBS
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CBS_PK'
and t.table_name='CBS'
drop index CBS.CBS_PK
end if;
if exists(
select 1 from sys.systable
where table_name='CBS'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table CBS
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CG2_FK'
and t.table_name='CG'
) then
drop index CG.CG2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CG_FK'
and t.table_name='CG'
) then
drop index CG.CG_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CG_PK'
and t.table_name='CG'
) then
drop index CG.CG_PK
end if;
select 1 from sys.systable
where table_name='CG'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table CG
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CZ2_FK'
and t.table_name='CZ'
) then
drop index CZ.CZ2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CZ_FK'
and t.table_name='CZ'
) then
drop index CZ.CZ_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='CZ_PK'
and t.table_name='CZ'
) then
drop index CZ.CZ_PK
end if;
if exists(
select 1 from sys.systable
where table_name='CZ'
and table_type in ('BASE', 'GBL TEMP')
drop table CZ
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GHDW_PK'
and t.table_name='GHDW'
) then
drop index GHDW.GHDW_PK
end if;
if exists(
select 1 from sys.systable
where table_name='GHDW'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table GHDW
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GK_PK'
and t.table_name='GK'
) then
drop index GK.GK_PK
end if;
if exists(
select 1 from sys.systable
where table_name='GK'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table GK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GM2_FK'
and t.table_name='GM'
) then
drop index GM.GM2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GM_FK'
and t.table_name='GM'
) then
drop index GM.GM_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='GM_PK'
and t.table_name='GM'
) then
drop index GM.GM_PK
end if;
if exists(
select 1 from sys.systable
where table_name='GM'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table GM
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='KF_PK'
and t.table_name='KF'
drop index KF.KF_PK
end if;
if exists(
select 1 from sys.systable
where table_name='KF'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table KF
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='RK2_FK'
and t.table_name='RK'
) then
drop index RK.RK2_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='RK_FK'
and t.table_name='RK'
) then
drop index RK.RK_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='RK_PK'
and t.table_name='RK'
) then
drop index RK.RK_PK
end if;
select 1 from sys.systable
where table_name='RK'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table RK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='TSZZ_PK'
and t.table_name='TSZZ'
) then
drop index TSZZ.TSZZ_PK
end if;
if exists(
select 1 from sys.systable
where table_name='TSZZ'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table TSZZ
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='出版_FK'
and t.table_name='TUSHU'
) then
drop index TUSHU.出版_FK
end if;
if exists(
select 1 from sys.sysindex i, sys.systable t
where i.table_id=t.table_id
and i.index_name='TUSHU_PK'
and t.table_name='TUSHU'
drop index TUSHU.TUSHU_PK
end if;
if exists(
select 1 from sys.systable
where table_name='TUSHU'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table TUSHU
end if;
/*==============================================================*/
/* Table: CBS */
/*==============================================================*/
create table CBS
(
CBSBH numeric(1111) not null,
BZ char(1111),
FZR char(1111),
YZBH numeric(1111),
DZ char(1111),
CBSMC char(1111),
constraint PK_CBS primary key (CBSBH)
);
/*==============================================================*/
/* Index: CBS_PK */
/*==============================================================*/
create unique index CBS_PK on CBS (
CBSBH ASC
);
/*==============================================================*/
/* Table: CG */
/*==============================================================*/
create table CG
(
TSBH numeric(1111) not null,
GHDWBH char(1111) not null,
CGJG money,
constraint PK_CG primary key clustered (TSBH, GHDWBH)
);
/*==============================================================*/
/* Index: CG_PK */
/*==============================================================*/
create unique clustered index CG_PK on CG (
TSBH ASC,
GHDWBH ASC
);
/*==============================================================*/
/* Index: CG_FK */
/*==============================================================*/
create index CG_FK on CG (
TSBH ASC
);
/*==============================================================*/
/* Index: CG2_FK */
/*==============================================================*/
create index CG2_FK on CG (
GHDWBH ASC
);
/*==============================================================*/
/* Table: CZ */
/*==============================================================*/
create table CZ
(
ZZBH numeric(1111) not null,
TSBH numeric(1111) not null,
constraint PK_CZ primary key clustered (ZZBH, TSBH)
);
/*==============================================================*/
/* Index: CZ_PK */
/*==============================================================*/
create unique clustered index CZ_PK on CZ (
ZZBH ASC,
TSBH ASC
);
/*==============================================================*/
/* Index: CZ_FK */
/*==============================================================*/
create index CZ_FK on CZ (
ZZBH ASC
);
/*==============================================================*/
/* Index: CZ2_FK */
/*==============================================================*/
create index CZ2_FK on CZ (
TSBH ASC
);
/*==============================================================*/
/* Table: GHDW */
/*==============================================================*/
create table GHDW
(
GHDWBH char(1111) not null,
GHDWMC char(1111),
GHDWDZ char(1111),
GHDWLXDH numeric(1111),
Attribute_24 char(10),
constraint PK_GHDW primary key (GHDWBH)
);
/*==============================================================*/
/* Index: GHDW_PK */
/*==============================================================*/
create unique index GHDW_PK on GHDW (
GHDWBH ASC
);
/*==============================================================*/
/* Table: GK */
/*==============================================================*/
create table GK
(
GKBH numeric(1111) not null,
ZDRQ timestamp,
GSCS numeric(1111),
DSAH char(1111),
GKXB varchar(1111),
GKXM char(1111),
constraint PK_GK primary key (GKBH)
/*==============================================================*/
/* Index: GK_PK */
/*==============================================================*/
create unique index GK_PK on GK (
GKBH ASC
);
/*==============================================================*/
/* Table: GM */
/*==============================================================*/
create table GM
(
TSBH numeric(1111) not null,
GKBH numeric(1111) not null,
XSSJ datetime,
XSSL money,
XSJG money,
constraint PK_GM primary key clustered (TSBH, GKBH)
);
/*==============================================================*/
/* Index: GM_PK */
/*==============================================================*/
create unique clustered index GM_PK on GM (
TSBH ASC,
GKBH ASC
);
/*==============================================================*/
/* Index: GM_FK */
/*==============================================================*/
create index GM_FK on GM (
TSBH ASC
);
/*==============================================================*/
/* Index: GM2_FK */
/*==============================================================*/
create index GM2_FK on GM (
GKBH ASC
);
/*==============================================================*/
/* Table: KF */
/*==============================================================*/
create table KF
(
KFBH numeric(1111) not null,
KFMC char(1111),
Attribute_19 char(10),
constraint PK_KF primary key (KFBH)
);
/*==============================================================*/
/* Index: KF_PK */
/*==============================================================*/
create unique index KF_PK on KF (
KFBH ASC
);
/*==============================================================*/
/* Table: RK */
/*==============================================================*/
create table RK
(
TSBH numeric(1111) not null,
KFBH numeric(1111) not null,
RKSL money,
RKRQ datetime,
constraint PK_RK primary key clustered (TSBH, KFBH)
);
/*==============================================================*/
/* Index: RK_PK */
/*==============================================================*/
create unique clustered index RK_PK on RK (
TSBH ASC,
KFBH ASC
);
/*==============================================================*/
/* Index: RK_FK */
/*==============================================================*/
create index RK_FK on RK (
TSBH ASC
);
/*==============================================================*/
/* Index: RK2_FK */
/*==============================================================*/
create index RK2_FK on RK (
KFBH ASC
);
/*==============================================================*/
/* Table: TSZZ */
/*==============================================================*/
create table TSZZ
(
ZZBH numeric(1111) not null,
XINGMING char(1111),
XINGBIE varchar(1111),
CSRQ date,
JJ char(1111),
constraint PK_TSZZ primary key (ZZBH)
);
/*==============================================================*/
/* Index: TSZZ_PK */
/*==============================================================*/
create unique index TSZZ_PK on TSZZ (
ZZBH ASC
);
/*==============================================================*/
/* Table: TUSHU */
/*==============================================================*/
create table TUSHU
(
TSBH numeric(1111) not null,
CBSBH numeric(1111),
SHUMING char(1111),
CBRQ date,
BANBEN varchar(1111),
JIAGE numeric(1111),
constraint PK_TUSHU primary key (TSBH)
/*==============================================================*/
/* Index: TUSHU_PK */
/*==============================================================*/
create unique index TUSHU_PK on TUSHU (
TSBH ASC
);
/*==============================================================*/
/* Index: 出版_FK */
/*==============================================================*/
create index 出版_FK on TUSHU (
CBSBH ASC
);
alter table CG
add constraint FK_CG_CG_TUSHU foreign key (TSBH)
references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table CG
add constraint FK_CG_CG2_GHDW foreign key (GHDWBH)
references GHDW (GHDWBH)
on update restrict
on delete restrict;
alter table CZ
add constraint FK_CZ_CZ_TSZZ foreign key (ZZBH)
references TSZZ (ZZBH)
on update restrict
on delete restrict;
alter table CZ
add constraint FK_CZ_CZ2_TUSHU foreign key (TSBH) references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table GM
add constraint FK_GM_GM_TUSHU foreign key (TSBH) references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table GM
add constraint FK_GM_GM2_GK foreign key (GKBH) references GK (GKBH)
on update restrict
on delete restrict;
alter table RK
add constraint FK_RK_RK_TUSHU foreign key (TSBH) references TUSHU (TSBH)
on update restrict
on delete restrict;
alter table RK
add constraint FK_RK_RK2_KF foreign key (KFBH) references KF (KFBH)
on update restrict
on delete restrict;
alter table TUSHU
add constraint FK_TUSHU_出版_CBS foreign key (CBSBH) references CBS (CBSBH)
on update restrict
on delete restrict;