没有合适的资源?快使用搜索试试~ 我知道了~
第二章答案1
需积分: 0 0 下载量 133 浏览量
2022-08-03
16:32:53
上传
评论
收藏 105KB PDF 举报
温馨提示
试读
15页
1. Professors can teach the same course in several semesters, and each offering
资源详情
资源评论
资源推荐
2
INTRODUCTION TO DATABASE
DESIGN
Exercise 2.1 Explain the following terms briefly: attribute, domain, entity, relation-
ship, entity set, relationship set, one-to-many relationship, many-to-many relationship,
participation constraint, overlap constraint, covering constraint, weak entity set, aggre-
gation,androle indicator.
Answer 2.1 Term explanations:
Attribute - a property or description of an entity. A toy department employee
entity could have attributes describing the employee’s name, salary, and years of
service.
Domain - a set of possible values for an attribute.
Entity - an object in the real world that is distinguishable from other objects such
as the green dragon toy.
Relationship - an association among two or more entities.
Entity set - a collection of similar entities such as all of the toys in the toy depart-
ment.
Relationship set - a collection of similar relationships
One-to-many relationship - a key constraint that indicates that one entity can be
associated with many of another entity. An example of a one-to-many relationship
is when an employee can work for only one department, and a department can
have many employees.
Many-to-many relationship - a key constraint that indicates that many of one
entity can be associated with many of another entity. An example of a many-
to-many relationship is employees and their hobbies: a person can have many
different hobbies, and many people can have the same hobby.
7
8 Chapter 2
Participation constraint - a participation constraint determines whether relation-
ships must involve certain entities. An example is if every department entity has
a manager entity. Participation constraints can either be total or partial. A total
participation constraint says that every department has a manager. A partial
participation constraint says that every employee does not have to be a manager.
Overlap constraint - within an ISA hierarchy, an overlap constraint determines
whether or not two subclasses can contain the same entity.
Covering constraint - within an ISA hierarchy, a covering constraint determines
where the entities in the subclasses collectively include all entities in the superclass.
For example, with an Employees entity set with subclasses HourlyEmployee and
SalaryEmployee, does every Employee entity necessarily have to be within either
HourlyEmployee or SalaryEmployee?
Weak entity set - an entity that cannot be identified uniquely without considering
some primary key attributes of another identifying owner entity. An example is
including Dependent information for employees for insurance purposes.
Aggregation - a feature of the entity relationship model that allows a relationship
set to participate in another relationship set. This is indicated on an ER diagram
by drawing a dashed box around the aggregation.
Role indicator - If an entity set plays more than one role, role indicators describe
the different purpose in the relationship. An example is a single Employee entity
set with a relation Reports-To that relates supervisors and subordinates.
Exercise 2.2 A university database contains information about professors (identified
by social security number, or SSN) and courses (identified by courseid). Professors
teach courses; each of the following situations concerns the Teaches relationship set. For
each situation, draw an ER diagram that describes it (assuming no further constraints
hold).
1. Professors can teach the same course in several semesters, and each offering must
be recorded.
2. Professors can teach the same course in several semesters, and only the most
recent such offering needs to be recorded. (Assume this condition applies in all
subsequent questions.)
3. Every professor must teach some course.
4. Every professor teaches exactly one course (no more, no less).
5. Every professor teaches exactly one course (no more, no less), and every course
must be taught by some professor.
Introduction to Database Design 9
Professor
ssn courseId
Teaches
Course
semesterid
Semester
Figure 2.1 ER Diagram for Exercise 2.2, Part 1
Professor
ssn courseId
Teaches
Course
semester
Figure 2.2 ER Diagram for Exercise 2.2, Part 2
6. Now suppose that certain courses can be taught by a team of professors jointly,
but it is possible that no one professor in a team can teach the course. Model this
situation, introducing additional entity sets and relationship sets if necessary.
Answer 2.2 1. The ER diagram is shown in Figure 2.1.
2. The ER diagram is shown in Figure 2.2.
3. The ER diagram is shown in Figure 2.3.
4. The ER diagram is shown in Figure 2.4.
5. The ER diagram is shown in Figure 2.5.
6. The E.R. diagram is shown in Figure 2.6. An additional entity set called Group
is introduced to identify the professors who team to teach a course. We assume
that only the latest offering of a course needs to be recorded.
Exercise 2.3 Consider the following information about a university database:
剩余14页未读,继续阅读
曹多鱼
- 粉丝: 19
- 资源: 314
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Excel考勤加班表,出勤公休,年假,出差,迟到,旷工,早退,事假,病假,加班,自动计算
- 我国10万接图表矢量文件(MapGis格式)
- 在MATLAB中,使用滤波器对加噪正弦波信号进行平滑处理
- Camera_XHS_17158256580511040g008312ar03ts5m2g5p7lo4318dbrrc91s80.jpg
- 11.html
- 一款开箱即用的 Vue 中后台管理系统框架
- lcd.hex
- 【管理系统源码】资源wxtpglxt-v1.0.zip
- 使用 Simulink 进行自适应 MPC 设计2015\使用 Simulink 进行自适应 MPC 设计2015
- levigo-jbig2-imageio-6.13
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0