云南大学数据库系统与设计实验6
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
云南大学软件学院
实验报告
姓名:赵宇学号:2010112018班级:2010级软件工程日期: 2013/5/24 成绩:
实验六 Physical Database Design II
一实验任务
对给出的实体建立关系数据模型,对建立的关系模型转化为DBMS中的数据库,对数据库中的数据的更新做约束,实现该数据库的业务要求,最后是对SQL 语句的考察,通过SQL语句对数据库中的数据进行查询。
二实验环境
SQL Server 2005 、Power Designer
三实验结果记录
1.已知StayHome 数据库各实体之间的关系如下图所示:
表中数据参考文件”StayHomeData.xls”,其中数据供参考,不足的属性或关联关系,请自己添加,并加说明。
需要添加一个表,演员和电影是多对多的关系,需要通过第三个表来实现对
3NF,同时对于员工表应该添加电话属性和性别属性,这样会更加方便对员工的管理。
2.使用数据库建模工具,给出StayHome 数据库的ER 模型图、LDM 图和PDM
图。
ER图:
Playsln
isPartOf
belong
Branch
branchNo street
city
state zipCode mgrStaffNo
Variable chara
Characters (20
Characters (6)
Characters (20
Characters (20
Identifier_1 ...
Staff
staffNo
name
position
salary
phone
gender
branchNo1
Variable char
Characters (5
Money
Integer
Characters (6
Characters (2 Identifier_1
...
VideoForRent
videoNO available catalogNo1 branchNo1
Characters (2
Characters (2
Actor
actorNo
actorName
actorGender
actorDescribe
Variable char
Characters (2
Text
Identifier_1
...
Video
catalogNo1
title
category
dailyRental
price
Variable char
Characters (2
Money
Money
Identifier_1
...
Member
memberNO
fname
lname
address
gender
Characters (1
Characters (1
Characters (5
Characters (6
Identifier_1
...
Registration
branchNo1
menberNo1
staffNo1
dateJoined
Characters (2
Characters (2
Characters (2
Date RentalAgreement
rentalNo
dateOut
dateReturn
menberNo1
videoNo2
Date
Date
Characters (
Characters (
Identifier_1
...
Director
directorNo
directorName
directorGender
directorDescribe
Variable chara
Identifier_1
...
LDM图:
Playsln
is
isPartOf
belong3
(D)
belong2
Branch
branchNo
street
city
state
zipCode
mgrStaffNo
Variable chara
Characters (20
Characters (6)
Characters (20
Characters (20
Identifier_1
...
Staff
staffNo
branchNo
Sta_staffNo
name
position
salary
phone
gender
branchNo1
...
Characters
Characters
Characters
Variable c
Characters
Money
Integer
Characters
Characters
VideoForRent
videoNO
available
catalogNo1 branchNo branchNo1
Charac Charac Charac Actor actorNo actorName actorGender actorDescribe Variable char Characters (2 Text Identifier_1 ... Video catalogNo1 title category dailyRental price Variable char Characters (2 Money Money Identifier_1 ... Member memberNO fname lname address gender Characters (1 Characters (1 Characters (5 Characters (6 Identifier_1 ... Registration memberNO branchNo staffNo branchNo1 menberNo1 staffNo1 ... Charact Charact Charact Charact Charact Charact RentalAgreement rentalNo memberNO dateOut dateReturn menberNo1 videoNo2 Characters Characters Date Date Characters Characters Director directorNo catalogNo1 directorName directorGender directorDescribe Characters (20 Characters (20 Variable chara Directs catalogNo1 actorNo Characters (20) Characters (20) Identifier_1 ... PDM图: