Databaseassignment2 F24605146
Databaseassignment2 F24605146
Tayyar
ID F24605146
Dept. CS-C-24
Question # 1:
Describe what entity type represents in an ER model and provide examples of entities with
physical or conceptual existence.
Solution:
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
Relationship Type
Instructor – Teaching Team Many-to-Many
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.
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:
_____________________________________________________________________________