Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Management System

Similar presentations


Presentation on theme: "Database Management System"— Presentation transcript:

1 Database Management System
Lecture - 9

2 Relationships

3 Relationships Relationships are the connections and interactions between the entities instances, e.g., Program and Student ETs are linked How to identify relationships

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

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

6 Symbol for Relationships
DEPT EMP BOOK STD

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

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

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

10 Binary Relationship Example
STD COURSE BOOK EMP PROJ

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

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

13 Attributes of Rships STD COURSE GRADE

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

15 Ternary Relationship Examples

16 STD COURSE FACULTY PROJ EMP SKILL

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

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

19 Unary Relationship Examples
STD ROOMMATE EMP CHAIR-PERSON SPOUSE

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

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

22 Types of Cardinalities
DEPT Chair Person One to one EMP DEPT One to many/ many to one PROJ EMP Many to many

23 Database Management System
Lecture - 9


Download ppt "Database Management System"

Similar presentations


Ads by Google