ER Diagram Assignment
ER Diagram Assignment
SENG 351
Semester 2 - 2024/2025
Assignment
Submission Date: April 30, 2025 Total Marks: 10
Instructions:
• Cheating
Objective: To practice modeling real-world scenarios using Entity-Relationship Diagrams, correctly identifying
entities, attributes, primary keys, and relationships (including cardinalities).
Instructions:
• Compulsory Questions (1-3): You MUST complete these three questions. Your solutions for these
questions will be evaluated and graded.
• Practice Questions (4-10): These seven questions are provided for your practice and self-assessment.
They cover similar concepts and will help reinforce your understanding. Submission is not required for
practice questions.
1|3
• For each question, draw a clear and legible Entity-Relationship Diagram (ERD).
• Use standard ERD notation (e.g., Crow's Foot notation is recommended) to clearly show the cardinality
(e.g., 1:1, 1:N, M:N) of each relationship.
• For Many-to-Many (M:N) relationships, ensure you include the necessary associative (linking) entity.
o Scenario: A university needs a database to track student enrollments in various courses offered
each semester.
o Relationship: A student can enroll in multiple courses, and a single course can have many
students enrolled. This represents a Many-to-Many (M:N) relationship.
o Task: Draw an ERD for this scenario. Remember that M:N relationships typically require an
associative entity (e.g., ENROLLMENT) to link the two main entities.
o Attributes:
▪ (Consider: What attributes might belong to the associative entity linking STUDENT and
COURSE, such as Enrollment_Date or Grade?)
o Scenario: A hospital needs to track which doctor is primarily responsible for treating each
admitted patient.
o Relationship: A patient is assigned to and treated by one primary doctor during their stay, but a
doctor can be responsible for treating multiple patients simultaneously. This is a One-to-Many
(1:N) relationship from DOCTOR to PATIENT.
o Task: Design an ERD representing this patient-doctor assignment. Indicate the Foreign Key (FK)
relationship clearly.
o Attributes:
2|3
▪ DOCTOR: Doctor_ID (PK), Name, Specialty
o Scenario: A library wants to catalog its books and the authors who wrote them.
o Relationship: A book can be written by one or more authors (co-authorship), and an author can
write multiple books. This is a Many-to-Many (M:N) relationship.
o Task: Draw an ERD, including the necessary associative entity (e.g., BOOK_AUTHORSHIP).
o Attributes:
o Relationship: A customer can place multiple orders over time. However, each individual order
is placed by only one specific customer. This is a One-to-Many (1:N) relationship from
CUSTOMER to ORDER.
o Task: Create an ERD for this customer-order relationship. Clearly show the linkage and
cardinality.
o Attributes:
o Scenario: A company needs to track which employees are assigned to which projects.
3|3
o Task: Design an ERD, including an associative entity (e.g., ASSIGNMENT) to manage the
relationship.
o Attributes:
o Scenario: A school needs to assign teachers to specific classes they will teach.
o Relationship: A teacher may be responsible for teaching multiple classes (e.g., different
sections of the same subject or different subjects), but each specific class instance (e.g., "Math
101 - Section A") is taught by only one teacher. This is a One-to-Many (1:N) relationship from
TEACHER to CLASS.
o Attributes:
▪ CLASS: Class_ID (PK), Class_Name, Grade_Level, (Consider: How is a CLASS linked to its
TEACHER?)
3. Banking System:
o Relationship: A customer can hold multiple accounts (e.g., savings, checking), but each
individual account belongs to only one primary customer (for simplicity, ignore joint accounts
here). This is a One-to-Many (1:N) relationship from CUSTOMER to ACCOUNT.
o Attributes:
4. Movie Database:
o Scenario: A database is needed to store information about movies and the actors who star in
them.
4|3
o Entities: MOVIE, ACTOR.
o Relationship: A movie typically features multiple actors, and an actor can appear in multiple
movies over their career. This is a Many-to-Many (M:N) relationship.
o Task: Design an ERD, including an associative entity (e.g., MOVIE_CAST or ROLE) to link movies
and actors.
o Attributes:
▪ (Consider: What attributes might the linking entity have, such as Character_Name?)
o Scenario: A sports league needs to track players and the teams they belong to.
o Relationship: For this league, assume a player can only be registered to one team at a time,
while a team consists of multiple players. This is a One-to-Many (1:N) relationship from TEAM
to PLAYER.
o Attributes:
▪ PLAYER: Player_ID (PK), Name, Position, (Consider: How is a PLAYER associated with
their TEAM?)
o Scenario: A research institution needs to track researchers and the projects they are working
on.
o Task: Draw an ERD, using an associative entity (e.g., PROJECT_ASSIGNMENT) to model this
relationship.
o Attributes:
5|3
▪ (Consider: What details might be tracked in the PROJECT_ASSIGNMENT,
like Role_On_Project or Contribution_Percentage?)
6|3