Title: UNARY RELATIONSHIP
1UNARY RELATIONSHIP
Manages
Is Married to
EMPLOYEE
PERSON
One-to-One
One-to-Many
2BINARY RELATIONSHIP
Is Assigned
EMPLOYEE
PARKING PLACE
One-to-one
Contains
PRODUCT LINE
PRODUCT
One-to-many
Registers for
STUDENT
COURSE
Many-to-many
3TERNARY RELATIONSHIP
PART
Ships
VENDOR
WAREHOUSE
QUANTITY
4GERUNDS
- A gerund (sometimes called a composite entity) is
a many-to-many relationship that the data modeler
chooses to model as an entity type with several
associated one-to-many relationships. - Example
5GERUNDS
VENDOR
PART
SHIPMENT NO.
QUANTITY
SHIPMENT
WAREHOUSE
6Cardinalities in Relationships
- The cardinality of a relationship is the number
of instances of entity B that can (or must) be
associated with each instance of entity A. - Example
Is Stocked as
MOVIE COPY
MOVIE
7Minimum and Maximum Cardinalities
- The minimum cardinality of a relationship is the
minimum number of instances of entity B that may
be associated with each instance of entity A. - The maximum cardinality of a relationship is the
maximum number of instances. - Example
8Has
PATIENT
PATIENT HISTORY
a) Mandatory cardinalities
Is Assigned to
EMPLOYEE
PROJECT
b) One optional, one mandatory cardinality
Is Married to
PERSON
c) Optional cardinalities
9Existence Dependency and Weak Entity
- Existence dependency means that an instance of
one entity cannot exist without the existence of
an instance of some other (related) entity. - A weak entity is an entity type that has an
existence dependency.
10Identifying Relationship
- An identifying relationship is one in which the
primary key of the parent entity is used as part
of the primary key of the dependent entity. - Two benefits of an Identifying Relationship
- Data Integrity. Existence dependencies are
enforced since the primary is shared. - Ease of access of the dependent entity.
- Example
11MOVIE NO.
MOVIE NAME
COPY NO.
MOVIE NO.
Is Stocked as
MOVIE
MOVIE COPY
Identifying Relationships
12Summary of Symbols Used in E-R Notation
ATTRIBUTE
ENTITY
PRIMARY KEY
RELATIONSHIP
MULTIVALUED ATTRIBUTE
GERUND
13RELATIONSHIP DEGREE
Unary
TERNARY
Is Assigned
EMPLOYEE
PARKING PLACE
Binary
14Relationship Cardinality
Mandatory 1 cardinality
Many (M) cardinality (1,2, many)
Optional 0 or 1 cardinality
Optional zero-many cardinality (0,1,2,,many)
15Class-subclass relationship
ISA
Exclusive relationship
16Alternative E-R Notation
17Alternative E-R Notation (contd.)
18Alternative E-R Notation (contd.)