Loading....
Coupon Accepted Successfully!

 

Relationships Sets

  • A relationship is an association among several entities.

Example:

Hayes depositor A-102
customer entity relationship set account entity

  • A relationship set is a mathematical relation among n *2 entities, each taken from entity sets.

{(e1, e2, … en) | e1 * E1, e2 * E2, …, en * En} where (e1, e2, …, en) is a relationship

 

Example:

(Hayes, A-102) * depositor

 

Degree of a relationship

Degree : the number of participating entities.

Degree 2: binary

Degree 3: ternary

Degree n: n-ary

Recursive relationship: An entity set relating to itself

gives rise to a recursive relationship.

 

E.g., the relationship prerequisite Of is an example of a

recursive relationship on the entity Course.

 

Diagrammatic Notation for Relationships

 

  • Relationship - diamond shaped box
  • Rectangle of each participating entity is connected by a line to this diamond. Name of the relationship is written in the box.

Binary Relationships and Cardinality Ratio

M N

  • The number of entities from E2 that an entity from E1 can possibly be associated thru R (and vice-versa) determines the cardinality ratio of R.
  • Four possibilities are usually specified:

1. one-to-one (1:1)

2. one-to-many (1:N)

3. many-to-one (N:1)

4. many-to-many (M:N)

Cardinality Ratios

One-to-one: An E1 entity may be associated with at most one E2 entity and similarly an E2 entity may be associated with at most one E1 entity.

One-to-many: An E1 entity may be associated with many E2 entities whereas an E2 entity may be associated with at most one E1 entity.

Many-to-one:( similar to above)

Many-to-many: Many E1 entities may be associated with a single E2 entity and a single E1 entity may be associated with many E2 entities.

A

B

C

R

E1 R E2

Mapping Cardinalities


One to one One to many

Note: Some elements in A and B may not be mapped to any elements in the other set.

Many to one Many to many

Note: Some elements in A and B may not be mapped to any elements in the other set.

 





Test Your Skills Now!
Take a Quiz now
Reviewer Name