Entity relationship

Preview:

Citation preview

Relationship degree

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

Three types of Relationship degree

1. Unary relationship2. Binary relationship3. Ternary relationship

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

“Recursive Relationship”

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

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

Three types of relationship degree

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.

“Recursive Relationship”

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

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.

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

Unary relationship are common in manufacturing industries…

Implementation of the recursive relationship “PART contains PART”

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

The 1:M recursive relationship “EMPLOYEE manages EMPLOYEE”

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?

“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…

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”

Example of Bridge .

Recommended