Entity
Entity
Entity
1
Relationship Set
§ A set of relationships of same type is known as
relationship set.
§ The following relationship set depicts S1 is enrolled in
C2, S2 is enrolled in C1 and S3 is enrolled in C3.
2
Degree of a relationship set
§ The number of different entity sets participating in a
relationship set is called as degree of a relationship set.
§ 1. Unary Relationship:
§ When there is only ONE entity set participating in a
relation, the relationship is called as unary relationship.
For example, one person is married to only one person.
3
§ 2. Binary Relationship:
§ When there are TWO entities set participating in a
relation, the relationship is called as binary relationship.
§ For example, Student is enrolled in Course.
4
§ 3. n-ary Relationship:
§ When there are n entities set participating in a relation,
the relationship is called as n-ary relationship.
§ For example: Ternary Relationship.
5
Cardinality
§ The number of times an entity of an entity set
participates in a relationship set is known as cardinality.
Cardinality can be of different types:
§ 1. One to one:
§ When each entity in each entity set can take part only
once in the relationship, the cardinality is one to one.
Let us assume that a male can marry to one female
and a female can marry to one male. So the
relationship will be one to one.
6
§ Using Sets, it can be represented as:
7
§ 2. Many to one:
§ When entities in one entity set can take part only once in the
relationship set and entities in other entity set can take part more than
once in the relationship set, cardinality is many to one.
§ Let us assume that a student can take only one course but one course
can be taken by many students. So the cardinality will be n to 1. It
means that for one course there can be n students but for one student,
there will be only one course.
8
§ Using Sets, it can be represented as:
10
§ Using sets, it can be represented as:
13
§ Using set, it can be represented as:
15
§ A weak entity type is represented by a double rectangle.
The participation of weak entity type is always total.
§ The relationship between weak entity type and its
identifying strong entity type is called identifying
relationship and it is represented by double diamond.
16