0% found this document useful (0 votes)
7 views13 pages

Databaseassignment2 F24605146

The document is an assignment on Database Systems, specifically focusing on Entity Relationship (ER) models. It includes explanations of entity types, examples of physical and conceptual entities, and the creation of ER diagrams for various scenarios. Additionally, it covers relationships and multiplicity within data models for different contexts, such as a video rental company and a university system.

Uploaded by

Saqib Awan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views13 pages

Databaseassignment2 F24605146

The document is an assignment on Database Systems, specifically focusing on Entity Relationship (ER) models. It includes explanations of entity types, examples of physical and conceptual entities, and the creation of ER diagrams for various scenarios. Additionally, it covers relationships and multiplicity within data models for different contexts, such as a video rental company and a university system.

Uploaded by

Saqib Awan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Name Syed Muhammad Jaffar

Tayyar

ID F24605146

Dept. CS-C-24

Assignment Database Systems


Assignment #2

Instructor Madam Kainat Babar


DATABASE SYSTEMS
Assignment # 2

Question # 1:
Describe what entity type represents in an ER model and provide examples of entities with
physical or conceptual existence.
Solution:

 What does the Entity type represent?


In an Entity Relationship model, an entity type represents a class of objects or a category with
the same features or same attributes which share common characteristics, stored in a database. It
helps in defining the structure of entities and the information related to them. We use an entity to
represent an idea or a person or anything with unique attributes or distinct information.

 Entity Types:
Entities can be:

 Physical Entity:
Tangible objects are represented by physical entities like employees,
students, etc.

 Conceptual Entity:
To represent abstract concepts like courses, transactions, projects we use
conceptual entity
Example:

1. A physical entity could be a Company, with attributes like Company_ID, Name, and
Location.
2. A conceptual entity could be Job Position, with attributes like Job_ID and Job_Title.

We can give many examples and real time scenario for taking an instance but for justification
these two examples and explanation that I have given above can help us understand what entity
type means to ER diagram.
Question # 2:
Create an ER diagram for each of the descriptions given in the question.

Solution:
Part (a):

Part (b):

Part (c):

Part (d):
Part (e):

Question # 3:
You are required to create a conceptual data model of the data requirements for a company
that specializes in IT training.
Solution:
Here is the solution to the question as per instruction:
Part (a): Main Entity types:

 Instructor
 Teaching Team
 Course
 Trainee
 Training Session

Part (b): Identifying Relationship types and Multiplicity:

Relationship Type
Instructor – Teaching Team Many-to-Many

Teaching Team - Course Many-to-One

Trainee - Course Many-to-One

Trainee – Training Session Many-to-One

Instructor - Research One-to-One


Part (c):

Question # 4:
Solution:
In this question which is about the video rental company, the primary entities include branches, staff,
members, videos, and rentals. The relationships such as "Manages" (for branch managers), "Rents" (for
customer rentals), and "Has Stock" (for branch video inventories) are identified. Each entity is assigned
attributes, including primary keys to ensure uniqueness. A final ER diagram integrates all these
components, maintaining consistency and enforceable constraints.

 Part (a):
Entity types:

 Branch
 Staff
 Video
 Video Copy
 Member
 Rental
Part (b & c):
Relationship Types and Multiplicity:
Entities Relations Cardinality Explanation
hip (Multiplicit
y)
Branch - Staff Employs 1 to Many A branch can have multiple staff
members, but each staff works at
only one branch.

Branch - Video Has 1 to 1 A branch can have multiple videos,


but each video belongs to one
branch.
Video - Video Has 1 to Many A video can have multiple copies,
Copy Copies but each copy belongs to only one
video.
Member - Branch Registers 1 to Many A member can register at multiple
At branches, and a branch can have
multiple registered members.

Member - Rental Rents Many to 1 A member can rent multiple videos,


but each rental belongs to one
member.
Video Copy - Is Rented 1 to Many A video copy can be rented multiple
Rental In times (over time), but each rental
involves one video copy.
Part (d-f): According to the question everything is mentioned in the ER
diagram.

Question # 5:
Solution:
For the university database involving professors and courses, different ER diagrams are created to
represent various constraints, such as professors teaching multiple semesters, team-teaching situations,
and ensuring that every professor is assigned a course. Depending on the scenario, multiplicity
constraints and optional participation rules are applied, ensuring flexibility while maintaining data
integrity.

Part (a):
Part (b):

Part (c):
Part (d):

Part (e):

Part (f):

Question # 6:
Solution:
The university system handling projects and departments has entities such as professors, graduate
students, projects, and departments. Relationships like "Manages" (between professors and
projects), "Works On" (for research involvement), and "Advises" (between senior and junior
graduate students) are established. The ER diagram captures these interactions while ensuring
constraints such as every project requiring a principal investigator.

Part (a):

Part (b):

Part (c):
Part (d):

Part (e):

Part (f):

Part (g):
Part (h):

Part (i):

Part (j):
Question # 7:
Solution:
In a company database where employees work in departments and have children, relationships like
"Works In" (between employees and departments), "Manages" (to indicate departmental
leadership), and "Has Child" (to track employees' children) are established. The diagram
incorporates constraints to ensure data consistency, such as uniquely identifying children based on
their parent's employment. The final ER model ensures that when an employee leaves the company,
related child data is also removed, maintaining data integrity.

ER-Diagram:

_____________________________________________________________________________

You might also like