Db-Lecture 9
Db-Lecture 9
Management
Systems
Lecture -9
Overview of Lecture
.
:Example of Relationship
DEPARTME
MANAGER manages NT
Degree of Relationship
• Unary Relationship
• Binary Relationship
• Ternary Relationship
Unary (degree 1)
• A unary relationship exists when
both the participating entity type
are the same. When such a
relationship is present we say that
the degree of relationship is 1.
• There are 3 main types of relationship in
a database:
• one-to-one
• one-to-many
• many-to-many
One –to-many
Binary Relationship
• A binary relationship exists when exactly two
entity type participates. Its means that a type
of relationship that involves two entity types is
called binary relationship. This type of
relationship has degree two. The real life used
relationship type.
• There are 3 main types of relationship in a
database:
• one-to-one
• one-to-many
• many-to-many
• One to One Relationship: This type of
relationship is rarely seen in real world.
• The above example describes that one
student can enroll only for one course and a
course will also have only one Student. This
is not what you will usually see in
relationship.
• One to Many : It reflects business rule
that one entity is associated with many
number of same entity. The example for
this relation might sound a little weird,
but this means that one student can enroll
to many courses, but one course will have
one Student.
Many to Many :
• The above diagram represents that many
students can enroll for more than one
courses.
Learn by example
DID
DNam
e
Works
Departmen
In t
Works
Departmen
In t
DNam
e
Works
Departmen
In t
Description Product
Has A
Address Name
PERSON
StId Qual
STD FAC
ST PERSON