ER Diagram Practice Questions
Question 1: University Course Management System
Domain: Education
Scenario:
A university wants to design a system to manage courses, instructors, and student enrollments.
Requirements:
-
The university offers multiple courses. Each course has a unique course ID, title, number of credits, and department.
-
Instructors teach one or more courses. Each instructor has a unique ID, name, email, and office number.
-
Students can enroll in multiple courses. Each student has a unique ID, name, email, and date of birth.
-
For every enrollment, the system should record the enrollment date and final grade.
-
Each course is taught by one instructor only.
-
A student can enroll in a course only once per semester.
Task:
Draw the ER diagram showing entities like Student
, Course
, Instructor
, Enrollment
, and their relationships with appropriate attributes and cardinalities.
Question 2: Online Retail Store System
Domain: E-commerce
Scenario:
An online retail store wants to manage its customers, orders, and products.
Requirements:
-
Customers have a unique ID, name, email, phone number, and shipping address.
-
Products have a unique product ID, name, description, price, and quantity in stock.
-
Customers can place multiple orders. Each order has a unique order ID, order date, and status.
-
An order can contain multiple products, and a product can appear in multiple orders (many-to-many).
-
The system should track the quantity of each product ordered and its price at the time of order.
-
Each order is placed by one customer only.
Task:
Design an ER diagram showing entities such as Customer
, Order
, Product
, and OrderDetails
(associative entity), with appropriate attributes and relationships.
Question 3: Hospital Patient Management System
Domain: Healthcare
Scenario:
A hospital wants to develop a database to manage patients, doctors, and appointments.
Requirements:
-
Patients have a unique ID, name, gender, date of birth, and address.
-
Doctors have a unique ID, name, specialization, and contact number.
-
Each appointment has a unique ID, appointment date, time, and status (e.g., scheduled, completed, canceled).
-
A patient can have multiple appointments with one or more doctors.
-
A doctor can see multiple patients through appointments.
-
The system should record which doctor sees which patient and the details of the appointment.
Task:
Create an ER diagram with entities like Patient
, Doctor
, and Appointment
, including attributes and relationships with cardinalities.
Question 4: Library Management System
Domain: Library Services
Scenario:
A library is setting up a database system to manage books, members, and borrowing records.
Requirements:
-
Books have a unique ISBN, title, author, publisher, and the number of copies.
-
Members have a unique ID, name, membership date, email, and phone number.
-
Each member can borrow multiple books, and a book can be borrowed by multiple members (many-to-many).
-
For every borrowing instance, record the issue date and return date.
-
A member cannot borrow the same book more than once at the same time (until it is returned).
-
The library may hold multiple copies of the same book.
Task:
Design an ER diagram that captures entities like Book
, Member
, Borrow
, and their relationships, including all necessary attributes and cardinalities.