Академический Документы
Профессиональный Документы
Культура Документы
http://www.beatsigner.com
2 December 2005
ISA
bottom-up approach
ISA Relationship
ISA
id
name
0..1
Persons
LivesAt
0..*
address
ISA
studentID
Students
Locations
Teachers
teaching
hours
ISA
research
topic
PhD
Students
Professors
#projects
ISA
ISA Constraints
ISA
Membership constraints
Disjointness constraints
ISA
Completeness constraints
ISA
name
ISA
id
Adults
birthdate
0..1
Persons
LivesAt
0..*
birthdate <
23.02.1996
address
ISA
studentID
Students
Teachers
ISA
research
topic
Locations
PhD
Students
teaching
hours
disjoint
Professors
#projects
Aggregation
A limitation of the ER model is that relationships cannot
be modelled over other relationship sets
to
Durations
Employees
id
Companies
WorksFor
name
name
address
Aggregation ...
We cannot just create a
4-ary relationship WorksFor
Introduce a new
4-ary Manages
relationship
from
Durations
Employees
id
problem: we
introduce some
redundancy!
Companies
WorksFor
name
name
address
Manages
to
Managers
10
Aggregation ...
from
to
Durations
Employees
id
name
Companies
WorksFor
name
address
Manages
Managers
11
Part-Of Hierarchies
Cars
3..4
1..1
CPartOf
TPartOf
1..1
1..1
Chassis
Tires
PartOf
subpart
superpart
0..1
Products
0..*
general Part-Of
PartOf
PartOf
particular product
12
ER Design Issues
When do we model something as an attribute
and when as an entity set?
13
Attribute or Entity?
Should the address in the example be modelled
as an attribute or as a separate entity?
age
#offices
birthday
Employees
id
name
0..1
0..*
Offices
address
street
LocatedAt
city
14
Attribute or Entity?
Should the duration be modelled as a from and to
attribute or as a separate entity?
to
Durations
Employees
id
Companies
WorksFor
name
name
address
15
Persons
child
mother
father
Parents
HasFather
child
Persons
child
HasMother
mother
16
ER Design Principles
Make sure that you pay attention to all the entities, their
relationships and any other constraints mentioned in the
description (requirements) of a specific application
domain
Avoid redundancy!
The resulting conceptual model should be as simple as
possible, but not simpler
17
18
ER Summary
Entities and attributes
Relationships
cardinality constraints
participation constraints
Keys
Weak entities
ISA hierarchies
Aggregation
19
Aristotle
20
Bertrand Russell
Ludwig Wittgenstein
21
OM Model
Data model that integrates concepts from
the entity-relationship and object-oriented
data models
Moira C. Norrie
22
Roles
Employees
employee
Semantic
Grouping
Designers
designer
p1
represented by
subtype
Typing
Females
p2
{ p1,p2 } p1,p2,p3,p4 }
subcollection
Collections
Objects
23
24
25
phone
birthday
Employees
id
name
ER entity set
employee
age
address
id
name
birthday
phone
address
age()
UML class
26
employee
0..1
LocatedAt
office
0..*
Offices
employee
employee
locatedAt
office
0..1
0..*
office
locatedAt
years
years
Employees
employee
LocatedAt
ER relationships
February 22, 2013
office
Offices
employee
employee
office
office
UML relationships
Beat Signer - Department of Computer Science - bsigner@vub.ac.be
27
teacher
ISA
PhD
Students
overlapping
Professors
Teachers
ISA
phdStudent
professor
teacher
disjoint
disjoint
PhD
Students
Professors
ER specialisation
February 22, 2013
phdStudent
professor
UML specialisation
28
Modelling Exercises
Model the RSL link model in ER
Define an ER model for the following application
You are going to develop a database for the Chamber of Commerce and Industry of Brussels (CVO) to manage information
about language courses in Dutch, Spanish, French and Italian.
The database should store information about the teachers and
students as well as the individual language courses. A semester
lasts for 13 weeks. Regular courses are scheduled for two
sessions (each 3 hours) per week; advanced courses for three
sessions (each 4 hours) per week. Each course has a difficulty
level (module) of 1, 2 or 3 and costs a certain amount of money.
A teacher may not give more than 4 courses and not teach in
more than 2 languages. Each student has to do a final exam and
will get a grade for the exam.
29
Homework
Study the following chapter of the
Database System Concepts book
chapter 7
- sections 7.8-7.10
- Extended ER Model (EER)
30
Exercise 2
Entity-Relationship (ER) model
Extended Entity-Relationship (EER) model
31
References
A. Silberschatz, H. Korth and S. Sudarshan,
Database System Concepts (Sixth Edition),
McGraw-Hill, 2010
32
Next Lecture
Relational Model and Relational Algebra
2 December 2005