23
Relationship degree - Indicates the number of entities or participants association with a relationship.

Entity relationship

Embed Size (px)

Citation preview

Page 1: Entity relationship

Relationship degree

- Indicates the number of entities or participants association with a relationship.

Page 2: Entity relationship

Three types of Relationship degree

1. Unary relationship2. Binary relationship3. Ternary relationship

Page 3: Entity relationship

1. Unary relationship- Exist when an association is maintained within a single entity.

“Recursive Relationship”

Page 4: Entity relationship

2. Binary relationship- Exist when two entities are associated in a relationship.

Page 5: Entity relationship

3. Ternary relationship- Exist when three entities are associated. Although higher degrees exist, they are rare and are not specifically named.

Page 6: Entity relationship

Three types of relationship degree

Page 7: Entity relationship

1. A DOCTOR writes one or more PRESCRIPTIONs.2. A PATIENT may receive one or more PRESCRIPTIONs.3. A DRUG may appear in one or more PRESCRIPTIONs.

Page 8: Entity relationship

“Recursive Relationship”

-Is one in which a relationship can exist between occurrences of the same entity set.

Page 9: Entity relationship

For example:

1:M UR “an EMPLOYEE may manage many EMPLOYEEs, and each EMPLOYEEs managed by one EMPLOYEE”

1:1 UR “an EMPLOYEE may be married to one and only one other EMPLOYEE”

M:N UR “ a COURSE may be a prerequisite to many other COURSEs, and each COURSE may have many other COURSEs as prerequisites.

Page 10: Entity relationship

1:1 UR “an EMPLOYEE may be married to one and only one other EMPLOYEE”

Page 11: Entity relationship

Unary relationship are common in manufacturing industries…

Page 12: Entity relationship

Implementation of the recursive relationship “PART contains PART”

Page 13: Entity relationship

The M:N recursive relationship might be more familiar in a school environment…

Page 14: Entity relationship

The 1:M recursive relationship “EMPLOYEE manages EMPLOYEE”

Page 15: Entity relationship

Participation as described is bidirectional, meaning that it must be addressed in both directions along

the relationship.

•Must every employee have a spouse who is an employee?

•Must every employee be spouse to another employee?

Page 16: Entity relationship

“NO” … it is possible to be an employee and not have another employee as a spouse. Also it possible to be an employee and not be the spouse of another employee…

Page 17: Entity relationship

Associative (composite) Entities-In the original ERM described by Chen, relationships do not contain attributes.-The associative entity is used to implement a M:N relationship between two or more entities. -Also known as a “Composite or Bridge entity”

Page 18: Entity relationship

Example of Bridge .

Page 19: Entity relationship
Page 20: Entity relationship
Page 21: Entity relationship
Page 22: Entity relationship
Page 23: Entity relationship