The document defines key concepts related to relationships in databases including: binary and ternary relationships which involve two or three entities, respectively. It describes the cardinality (minimum and maximum number of instances) of relationships as either one-to-one, one-to-many, or many-to-many depending on whether the maximum is one or many on each side. Examples of relationships given include students reading for a degree or employees being employed by a company.
2. A mathematical definition:
if A, B are sets, then a relation R is a subset of A x B
A={1,2,3}, B={a,b,c,d},
R = {(1,a), (1,c), (3,b)}
- makes is a subset of Product x Company:
1
2
3
a
b
c
d
A=
B=
makes Company
Product
3. Relationship
Relationship is defined as a meaningful association among instance
of one or more entities.
E.g. Students reads for degree, Students passes course, Teacher
serve department.
Degree of Relationship
Number of entities involved in a relationship
Types of Relationship
Unary Relationship
A relationship among instance of single entities
4. Binary Relationship
A relationship among instance of two entities
Ternary Relationship
A relationship among instance of three entities.
Maximum Cardinality
If and b are two associated entities then maximum cardinality of A
will be the maximum number of instance of A that can be
associated with a single instance of B.
Maximum cardinality can be either one or many
5. Minimum Cardinality
If and b are two associated entities then minimum cardinality of A
will be the minimum number of instance of A that can be
associated with a single instance of B.
minimum cardinality can be either zero or one
Types of Relationship on the basis of Maximum Cardinality
One-to-One Relationship
A relationship having cardinality one on both sides
One-to-Many Relationship
A relationship having cardinality one on one side and many on other side
Many-to-Many Relationship
A relationship having cardinality many on both sides