Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Representation in ER-Model
Entities
Relationships
Attributes
Connectivity and Cardinality
ER Notation
Entities
Relationships
A Relationship represents an
association between two or more
entities.
Example - Employees are assigned
projects.
Attributes
1. A one-to-one relationship.
2. A one-to-many relationship.
3. A many-to-many relationship.
A many-to-many relationship
which is when for one instance of
entity A, there are zero, one, or
many instances of entity B and for
one instance of entity B there are
zero, one, or many instances of
entity A.
ER Notation
Attributes - Ellipses
Relationship Sets - Diamonds
Cardinalities An arrow or a 1 pointing where one
entity can be mapped
E-R Constraints
Types of constraints
Borrow
s
Loan
18
Data kept about each student include :name, address, telephone numbers,
ID#, gender, and birth date.
For a course we would like to keep data concerning course-Id, course title,
max. grade and number of lectures given/week.
Section's data include Section#, room number where lectures are given,
teacher's name.
Section numbers are always 1, 2, ..etc. for each course.
The DB should keep the date when the student registered in the course,
his final grade
19
Step 1:
The first step to extract the entities or
tables form the last case as the
following
Course
Student
Section
Teacher
20
Step 2
To extract the attributes inside in each
Tables
Note the types of attributes as discussed before (Simple, composite,
Multivalve, derived,Key)
21
Step 3
22
Step 4
23
Step 5
24
Special cases
25
A Ternary Relationship
SID
Quantity
supplier
supply
JID
project
part
PID
26
LN
1:1
EMPLOYEE
0:N
SUPERVISES
SS
27
vehicle
own
s
fixes
mechanic
parts
ER Advantages
ER Disadvantages