Assignment 1
Assignment 1
UNIT- I
CONCEPTUAL DATA MODELING
S. NO. QUESTIONS COs K Level
Case Study: University Course Registration System
Scenario
A university needs a system to manage course registrations. The
system should track information about students, courses, instructors,
departments, and enrollments.
Requirements
1. Entities:
Students: Each student has a unique student ID, name, date of
birth, and major.
Courses: Each course has a unique course ID, title, description,
and number of credits.
Instructors: Each instructor has a unique instructor ID, name,
and department.
Departments: Each department has a unique department ID,
name, and building location.
1 Enrollments: Each enrollment records the student, course, CO1 BTL-3
semester, and grade.
2. Relationships:
A student can enroll in multiple courses.
An instructor can teach multiple courses.
Each course is offered by one department.
Each instructor belongs to one department.
3. Constraints:
A student cannot enroll in the same course more than once per
semester.
An instructor can only teach courses offered by their
department.
Tasks
1. Identify the entities, attributes, and relationships.
2. Draw the ER diagram for the system.
3. Specify the primary keys, foreign keys, and any constraints.
Case Study: Library Management System
Scenario
A library needs a system to manage its operations, including tracking
books, members, loans, authors, and reservations.
2 Requirements CO1 BTL-3
1. Entities:
Books: Each book has a unique book ID, title, ISBN,
publication year, and genre.
Members: Each member has a unique member ID, name, date
of membership, and contact information.
Loans: Each loan has a unique loan ID, loan date, and return
date.
Authors: Each author has a unique author ID, name, and
nationality.
Reservations: Each reservation has a unique reservation ID,
date, and status.
2. Relationships:
A book can have multiple authors.
A member can borrow multiple books.
A member can reserve multiple books.
A book can be reserved by multiple members.
3. Constraints:
A loan must be associated with one member and one book.
A reservation must be associated with one member and one
book.
Tasks
1. Identify the entities, attributes, and relationships.
2. Draw the ER diagram for the system.
3. Specify the primary keys, foreign keys, and any constraints.
Design an ER diagram for a comprehensive system (e.g., a university
campus management system, an airline reservation system, or an e-
3 commerce platform). Present your ER diagram and explain the CO1 BTL-3
rationale behind your design choices, including the entities,
relationships, attributes, and constraints.
Compare and contrast the ER model with other data modeling
4 techniques such as UML class diagrams and Object-Role Modeling CO1 BTL-2
(ORM). Discuss the advantages and disadvantages of each approach.
Explain the concepts of specialization and generalization in the ER
5 model. Illustrate these concepts with an ER diagram for an employee CO1 BTL-2
management system where employees can be classified as Full-Time
or Part-Time.
Case Study: Online Shopping System
Scenario
An online shopping platform needs a database to manage its
operations. The system should track customers, products, orders,
payments, and reviews.
Requirements
1. Entities:
Customers: Each customer has a unique customer ID, name,
email, and shipping address.
Products: Each product has a unique product ID, name,
6 description, price, and stock quantity. CO1 BTL-3
Orders: Each order has a unique order ID, date, and status.
Payments: Each payment has a unique payment ID, date,
amount, and payment method.
Reviews: Each review has a unique review ID, rating,
comment, and date.
2. Relationships:
A customer can place multiple orders.
An order can contain multiple products.
A product can be reviewed by multiple customers.
A customer can make multiple payments for different orders.
3. Constraints:
An order must have at least one product.
A review must be associated with an existing product.
Tasks
1. Identify the entities, attributes, and relationships.
2. Draw the ER diagram for the system.
3. Specify the primary keys, foreign keys, and any constraints.
Case Study: Hospital Management System
Scenario
A hospital needs a database system to manage patient records, doctors,
appointments, treatments, and medical tests.
Requirements
1. Entities:
Patients: Each patient has a unique patient ID, name, date of
birth, and contact information.
Doctors: Each doctor has a unique doctor ID, name,
specialization, and contact information.
Appointments: Each appointment has a unique appointment
ID, date, time, and status.
Treatments: Each treatment has a unique treatment ID, name,
description, and cost.
8 Medical Tests: Each test has a unique test ID, name, CO1 BTL-3
description, and cost.
2. Relationships:
A patient can have multiple appointments.
A doctor can have multiple appointments with different
patients.
An appointment can include multiple treatments.
A patient can undergo multiple medical tests.
3. Constraints:
An appointment must involve one patient and one doctor.
A treatment can be associated with multiple appointments.
A medical test must be prescribed for a patient.
Tasks
1. Identify the entities, attributes, and relationships.
2. Draw the ER diagram for the system.
3. Specify the primary keys, foreign keys, and any constraints.
Design an EER diagram for a hospital management system that
includes patients, doctors, departments, and appointments. Use
9 specialization to differentiate between inpatient and outpatient CO1 BTL-3
services. Explain the EER concepts used and how they are applied to
represent the hospital’s data.
Case Study: Vehicle Rental System
Scenario
A vehicle rental company needs a system to manage its rentals,
vehicles, customers, and payments.
Requirements
10 1. Entities:
CO1 BTL-3
Customers: Each customer has a unique customer ID, name,
driver’s license number, and contact information.
Vehicles: Each vehicle has a unique vehicle ID, make, model,
year, and rental rate.
Rentals: Each rental has a unique rental ID, start date, end date,
and status.
Payments: Each payment has a unique payment ID, amount,
date, and payment method.
2. Relationships:
A customer can rent multiple vehicles.
A vehicle can be rented multiple times.
A rental can have multiple payments.
3. Constraints:
A rental must be associated with one customer and one
vehicle.
A payment must be associated with one rental.
Tasks
1. Identify the entities, attributes, and relationships.
2. Draw the ER diagram for the system.
3. Specify the primary keys, foreign keys, and any constraints.
Design a database for an automobile company to provide to its dealers
to assist them in maintaining customer records and dealer inventory
and to assist sales staff in ordering cars. Each vehicle is identified by
a vehicle identification number (VIN). Each individual vehicle is a
particular model of a particular brand offered by the company (e.g.,
the XF is a model of the car brand Jaguar of Tata Motors). Each model
11 can be offered with a variety of options, but an individual car may CO1 BTL-3
have only some (or none) of the available options. The database needs
to store information about models, brands, and options, as well as
information about individual dealers, customers, and cars.
Your design should include an E-R diagram, a set of relational
schemas, and a list of constraints, including primary-key and
foreign-key constraints.
Construct an E-R diagram for a car insurance company whose
customers own one or more cars each. Each car has associated with it
zero to any number of recorded accidents. Each insurance policy
12 covers one or more cars, and has one or more premium payments CO1 BTL-3
associated with it. Each payment is for a particular period of time, and
has an associated due date, and the date when the payment was
received.
UNIT - II
RELATIONAL MODEL AND SQL
i) Write a SQL query to list all patients (Patients table) who have
not had any appointments in the last 6 months.
4 ii) Update the InsuranceID of patients in the Patients table to a CO2 BTL-3
new insurance provider if their current insurance provider is
'OldInsuranceCo'.
iii) Delete all appointment records from the Appointments table
where the AppointmentDate is more than 5 years old.
iv) Write a SQL query to find the total number of patients in each
age group (e.g., 0-18, 19-35, 36-50, 51+) based on their DOB
in the Patients table.
Given the tables Books (BookID, Title, AuthorID, Genre,
AvailableCopies) and BorrowRecords (RecordID, BookID,
BorrowerID, BorrowDate, ReturnDate), write a SQL query to find the
most frequently borrowed books in the last year.
UNIT- III
RELATIONAL DATABASE DESIGN AND NORMALIZATION
S. NO. QUESTIONS COs K-Level
Consider the following ER diagram:
2 Weak Entity: Order (OrderID, OrderDate) with partial key OrderID CO3 BTL-3
and CustomerID as a foreign key.