0% found this document useful (0 votes)
3 views

end-sem (IT)

This document outlines the end-semester examination for the Database Management Systems course at Dr. B R Ambedkar National Institute of Technology, Jalandhar. It includes the exam duration, marks distribution, and a series of questions covering various topics such as relational databases, relational algebra, anomalies in databases, ACID properties, and schema design. Students are required to attempt all questions with complete justifications.

Uploaded by

atharvg.cs.23
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)
3 views

end-sem (IT)

This document outlines the end-semester examination for the Database Management Systems course at Dr. B R Ambedkar National Institute of Technology, Jalandhar. It includes the exam duration, marks distribution, and a series of questions covering various topics such as relational databases, relational algebra, anomalies in databases, ACID properties, and schema design. Students are required to attempt all questions with complete justifications.

Uploaded by

atharvg.cs.23
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/ 4

Roll No………………….

Dr B R Ambedkar National Institute of Technology, Jalandhar


B. Tech (Information Technology) 3rd Semester
ITDC0207, Database Management Systems
End-Semester Examination, December-2024
Duration: 03 Hours Max. Marks: 50 Date: Dec 07, 2024
Marks Distribution & Mapping of Questions with Course Outcomes
(COs)
Question Number 1 2 3 4 5
Max. Marks 10 10 10 10 10
CO No. 2 1,2 3,4 4,5 3
*Cognitive Level R,Ap Ap R,An,E U,R E,C
**Section/Chapter/Unit 2 1,2 3,4 4,5 3
Note:
i. Attempt all the questions.
ii. Write all your answers with complete justification.

Q1. Consider the following tables for a retail database: [5x2]

CUSTOMERS (CustID, Name, Email, JoinDate, City)


PRODUCTS (ProdID, Name, Category, Price, Stock)
ORDERS (OrderID, CustID, OrderDate, Status, Total)
ORDER_ITEMS (OrderID, ProdID, Quantity, UnitPrice)

(a) Find the customers who've spent the most in 2023 (top 3
only). Include their total purchase amount and order count.
(b) Create a category-wise sales report showing total revenue,
number of distinct customers, and the most sold product
name. Include only categories exceeding $1000 in sales.
(c) Identify customers who show consecutive day purchasing
patterns. Display the customer's name, dates of consecutive
orders, and the amount spent on each order.
(d) Produce a 2023 monthly sales analysis comparing revenue,
customer acquisition, and top-selling product with previous
month's performance.
(e) Analyse product purchase patterns to find items frequently
purchased together (minimum 5 co-occurrences in orders).
Show the product pairs and their purchase frequency.
1
Q2. Considering the following schema:
− Students:StudentID (primary key), Name, Age, Major
− Courses:CourseID (primary key), CourseName, Credits
− Enrollments: StudentID (foreign key referencing Students),
CourseID (foreign key referencing Courses), Grade
− Professors:ProfessorID (primary key), Name, Department
− Teaches:ProfessorID (foreign key referencing Professors),
CourseID (foreign key referencing Courses), Semester

Write down the following relational algebra query? [5x2]

(a) Find the Names of Students Who Are Enrolled in All Courses
Taught by "Dr. Smith".
(b) Retrieve the Names and Majors of Students Who Have Scored
an 'A' in More Than Two Courses.
(c) List the Course Names and Total Number of Students
Enrolled in Each Course Taught in the Fall Semester.
(d) Find Students Who Are Majoring in the Same Department as
Their Professors.
(e) List the Names of Professors Who Have Never Taught a
Course Taken by Students Under 20 Years Old.

Q3. Answer the following:


(a) Consider a scenario a university database contains a Courses
table that includes columns for CourseID, CourseName, and
ProfessorID. Currently, there are no professors assigned to
some new courses. Explain how an insertion anomaly could
arise in this situation. Propose a solution to mitigate this issue
and justify your choice. [2.5]

(b) Consider a Scenario hospital database has a


Patient_Treatment table that includes PatientID,
TreatmentID, PatientName, and TreatmentDate. If a patient’s
treatment record is deleted, all information about the patient
is lost. Describe how a deletion anomaly could occur in this
setup. Suggest a normalization strategy to resolve this issue
and explain its benefits. [2.5]

2
(c) Consider the ER diagram shown in Figure for part of a BANK
database. Each bank can have multiple branches, and each
branch can have multiple accounts and loans. [5x1]
i. List the strong (nonweak) entity types in the ER diagram.
ii. Is there a weak entity type? If so, give its name, partial
key, and identifying relationship.
iii. What constraints do the partial key and the identifying
relationship of the weak entity type specify in this
diagram?
iv. List the names of all relationship types, and specify the
(min, max) constraint on each participation of an entity
type in a relationship type. Justify your choices.
v. Identify different keys in the Figure.

Q4. Answer the following in brief: [2.5x4]


(a) Define ACID properties of transactions. How does each
property contribute to database reliability?
(b) Explain the concept of schedules and schedule equivalence.
What makes two schedules equivalent?
(c) Compare View Serializability and Conflict Serializability.

3
(d) Explain the differences between immediate update and
deferred update protocols in transaction recovery. Give one
advantage and disadvantage of each.

Q5. Suppose that we have the following requirements for a university


database that is used to keep track of students’ transcripts:
− The university keeps track of each student’s name (Sname),
student number (Snum), Social security number (Ssn), current
address (Sc_addr) and phone (Sc_phone), permanent address
(Sp_addr) and phone (Sp_phone), birth date (Bdate), sex
(Sex), class (Class) (‘freshman’, ‘sophomore’, … ,
‘graduate’), major department (Major_code), minor
department (Minor_code) (if any), and degree program (Prog)
(‘b.a.’, ‘b.s.’, … , ‘ph.d.’). Both Ssn and student number have
unique values for each student.
− Each department is described by a name (Dname), department
code (Dcode), office number (Doffice), office phone
(Dphone), and college (Dcollege). Both name and code have
unique values for each department.
− Each course has a course name (Cname), description (Cdesc),
course number (Cnum), number of semester hours (Credit),
level (Level), and offering department (Cdept). The course
number is unique for each course.
− Each section has an instructor (Iname), semester (Semester),
year (Year), course (Sec_course), and section number
(Sec_num). The section number distinguishes different
sections of the same course that are taught during the same
semester/year; its values are 1, 2, 3, … , up to the total number
of sections taught during each semester.
− A grade record refers to a student (Ssn), a particular section,
and a grade (Grade).
Design a relational database schema for this database application.
First show all the functional dependencies that should hold among
the attributes. Then design relation schemas for the database that
are each in 3NF or BCNF. Specify the key attributes of each
relation. Note any unspecified requirements, and make
appropriate assumptions to render the specification complete. [10]

*****

You might also like