Assignment # 01: Comsats
Assignment # 01: Comsats
By
AQIB RAZA
CIIT/FA19-BCS-126/ATK
Teacher: Mr. WASEEM KHAN
Submission Date: Wednesday, March 17, 2021
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:
Example #2:
Consider a Supplier that supplies a Processor to the company INTEL and NIVIDIA.
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.
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.
Relationship between records is of the parent child Relationship between records is expressed in
type the form of pointers or links.