end-sem (IT)
end-sem (IT)
(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
(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.
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.
3
(d) Explain the differences between immediate update and
deferred update protocols in transaction recovery. Give one
advantage and disadvantage of each.
*****