Degree of relationships in DBMS and cardinality

Saqlain84 265 views 22 slides Sep 23, 2023
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

Degree of relationships in DBMS and cardinality


Slide Content

Database
Management
System
Lecture -7

Relationships

Relationships
Relationships are the connections
and interactionsbetween the
entities instances, e.g., Program
and Student ETs are linked
How to identify relationships

Naming Relationships
Up to you
If there is no proper name of
the association in the system
then participants’ names of
abbreviations are used

Naming
STUDENT and CLASS have
ENROLL relationship
However, it can also be
named as STD_CLS

Symbol for Relationships
DEPT EMP
BOOKSTD

Relationships
Relationship type can be
identified like an entity type
A relationship type is an
abstraction of a relationship

Relationships
Entities involved in a relationship
are called its participants
Types of the relationships can be
established on the basis of
participant ETs

Relationships Types
A Binary relationship is the one
that links two entity types e.g.
STUDENT-CLASS

Binary Relationship Example
STD COURSE
BOOKSTD
EMPPROJ

Binary Relationships
May also have instances, that can
be formally described in an
ordered pair form
{(S1001, OS), (S1020, DS),
(S1002, DS), (S1058, NW)}

Attributes of the Rships
The key
The relationships can have
their descriptive attributes
Where to place

Attributes of Rships
STD COURSE
GRADE

Ternary Relationships
One that involves three entity
types
STUDENT-CLASS-FACULTY

Ternary Relationship
Examples

STD COURSE
FACULTY
PROJ EMP
SKILL

Ternary Relationships
Instances in ordered triples
Example {(S1013, MCS4,
Adnan), (S1023, MCS3,
Fasih)}

Unary Relationship
An ET linked with itself, also
called recursive relationship
Example Roommate, where
STUDENT is linked with
STUDENT

Unary Relationship Examples
STD ROOMMAT
E
EMP
CHAIR-
PERSON
EMP SPOUSE

Cardinality of Rships
Number of instances of one
entity type that can possibly be
related to instances of other
entity type

Types of Cardinalities
One to one
One to many
Many to one
Many to many

Types of Cardinalities
DEPT
Chair
Person
One to one
EMPDEPT
One to many/ many to one
PROJEMP
PROJEMP
Many to many
Tags