You are on page 1of 8

Assignment # 01

By

AQIB RAZA
CIIT/FA19-BCS-126/ATK
Teacher: Mr. WASEEM KHAN
Submission Date: Wednesday, March 17, 2021

COMSATS University Islamabad


Attock Campus
Spring, 2021
UNARY RELATIONSHIP
Example #1:
Subjects may be prerequisites for other subjects.

Example #2:

Suppose in a company, we have many employees who belong to a particular department like CS department,
EE department etc. So, a particular group of employees is managed by their respective department. So, the
‘employee’ is the only entity participating here.

Example #3:

A person may be married to only one person and person’ is the only entity participating here
Example #4:

Suppose in a classroom, we have many students who belong to a particular club-like dance club, basketball
club etc. and some of them are club leads. So, a particular group of students is managed by their respective
club lead. Here, the group is formed from students and, the club leads are chosen from students. So, the
‘Student’ is the only entity participating here.

Example #5:

Suppose in a company, we have many employees who belong to a particular department like CS department,
EE department etc. So, a particular group of employees is supervised by their respective department. So, the
‘employee’ is the only entity participating here.

BINARY RELATIONSHIP

Example #1:

Department is managed by Principal Teacher. the ‘principal teacher’ and ‘department’ are the entities
participating here.
Example #2:

A Subject can be offered. Here ‘subject’ and ‘offering’ are the entities.

Example #3:

In the case of an Invoice that has Invoice Lines, an INVOICE LINE must be associated with an INVOICE and
here ‘invoice’ and ‘invoice line’ are the entities.

Example #4:

Employees work on company here ‘employee’ and ‘company’ are the entities.

Example #5:

Suppose we have bank and customer make an account in a bank here we have two entity type ‘Customer’
and ‘Account’ 
TERNARY RELATIONSHIP
Example #1:

Consider a Mobile manufacture company. There are three different entities involved:

Mobile - Manufactured by company.

Part - Mobile Part which company get from Supplier.

Supplier - Supplier supplies Mobile parts to Company.

Example #2:
Consider a Supplier that supplies a Processor to the company INTEL and NIVIDIA.

There are three different entities involved:

intel

NVidia

Supplier
Example #3:

Consider the technician that uses notebook to work on project here ‘technician’ , ’project’ and ‘notebook’ are
entities.

Example #4:

Teacher uses textbook to teach class here ‘textbook’, ’faculty’ and ‘class’ are the entities.

Example #5:
employee uses skill to create project here ‘skill’, ’project’ and ‘employee’ are the entities.

DIFFERENCE BETWEEN HIERARCHICAL AND NETWORK


DATABASE MODEL

In Hierarchical data model, relationship between table and data is defined in parent child structure. In this
structure data are arranged in the form of a tree structure. This model supports one-to-one and one-to-many
relationships.

On the other hand, network model arrange data in graph structure. In this model each parent can have multiple
children and children can also have multiple parents. This model supports many to many relationships also.

HIERARCHICAL DATA MODEL NETWORK DATA MODEL

Relationship between records is of the parent child Relationship between records is expressed in
type the form of pointers or links.

It can have data inconsistency during the updating No Data inconsistency


and deletion of the data
Traversing of data is complex Data traversing is easy because node can be
accessed from parent to child or child to parent

It creates tree like structure


It supports graph like structure 

It does not support many to many relationships


It supports many to many relationships

You might also like