Professional Documents
Culture Documents
Csi ZG518 Ec-3m Second Sem 2021-2022
Csi ZG518 Ec-3m Second Sem 2021-2022
Csi ZG518 Ec-3m Second Sem 2021-2022
Comprehensive Examination
(EC-3 Makeup)
( 3 marks)
(3.5 marks)
c. Is this result equivalence?
(3.5 marks)
Total marks: 10 marks.
Q.2 Set. (A)
a. Consider the following code and Find out the what type of 2PL locking is used:
i) Lock_S(A)
Lock_X(B)
Lock_X( C)
R(A)
Unlock(A)
B= B-C+A
C = A -C
W(B)
Unlock(B)
W( C)
Unlock( C)
Commit (1.5 marks)
ii) Lock_S(A)
R(A)
Lock_X(B)
B= A+ 10
W(B)
Lock_X( C)
R( C)
C = B+ C
W( C)
Commit
Unlock(A)
Unlock(B)
Unlock( C) (1.5 marks)
b. Produce a wait-for graph for the following transaction scenario and determine whether a
deadlock exists.
(3 marks)
(2 mark)
Total marks : 10 marks.
Q.2 Set. (C)
a. Consider the execution shown below. Determine Undo and redo list
(Be precise about the points at which Undo begins and ends.)
(4 marks)
i)If the system fails repeatedly during recovery, what is the maximum number of log
records that can be written (as a function of the number of update and other log records
written before the crash) before restart completes successfully? (3 marks)
ii)What is the oldest log record that we need to retain? (3 marks)
Total marks : 10 marks.
Q.3 Set. (A) Albania data are designing backend for an Employee -payroll systems at JK
company.
They have to maintain employee records, different departments, Attendance , update
payrolls and generate monthly pay slip. There are some people who would use the DB
and they are employee, administrator, manager of each department and finally
accountant of JK. How do we implement this
Employee Can only see that data
Manager of a department Changes the attendance if employee reports
late for duty
Administrator Maintains whole db
Accountant Deals with salary of all employee and
generates pay slip.
What all database objects are required like SP, Triggers, forms and others
(7 marks)
Total marks: 7 marks.
Q.3 Set. (B) NM DB designers are designing backend for an Customer systems at JK ISP
company which has huge client base and they cater to broadband, mobile phone
connections .
They have to maintain customer records, different packages for each service , Bill
reminders, technical issues and complaints and generate monthly bill. There are some
people who would use the DB and they are manager, senior tech, supervisor and
customer service person of JK. How do we implement this
Manager Can make changes if needed
Senior Tech Fixes the technical issues in any service and
update the db
Supervisor Can correct the bill if wrongly computed or if
customers concern is legit
Customer service person Deals with customer query and so this person
can only view data.
What all database objects are required like SP, Triggers, forms and others
(7 marks)
Total marks: 7 marks.
Q.3 Set. (C) UNIVAC DB are designing backend for Attendence-payroll systems at CA
University.
They have to maintain employee records, different departments, Attendance , update
payrolls and generate monthly pay slip. There are some people who would use the DB
and they are Employee are faculty and technical and non technical staffs, administrator,
manager of each department and finally accountant of CA Uni. How do we implement
this
Employee Can only see that data
Manager of a department Changes the attendance if employee reports
late for duty
Administrator Maintains whole db
Accountant Deals with salary of all employee and
generates pay slip.
What all database objects are required like SP, Triggers, forms and others.
(7 marks)
Total marks: 7 marks.
Q.4 Set. (A) Consider the following SQL statement:
SELECT lname
FROM employee, works on, project
WHERE pname='Aquarius' and pnumber=pno and essn=ssn
and bdate > '1957-12-31';
Suppose the selection cardinalities (number of tuples in the resulting relation after ap-
plying the selection operation) for all selection conditions in the above WHERE clause
are as follows.
For the following query, prepare the initial (canonical) query tree, then show how the query tree
is optimized by the use of heuristic optimization.
a. Draw the query tree. (5 marks)
b. Draw the heuristic optimization tree. (5 marks)
Total marks: 10 marks.
Q.4 Set. (B) Consider the following SQL query that _nds all applicants who want to major in
CSE, live in Seattle, and go to a school ranked better than 10 (i.e., rank < 10).
And assuming:
_ Each school has a unique rank number (srank value) between 1 and 100.
_ There are 20 different cities.
_ Applicants.sid is a foreign key that references Schools.sid.
_ Major.id is a foreign key that references Applicants.id.
_ There is an unclustered, secondary B+ tree index on Major.id and all index pages are in
memory.
Compare the cost of two different query plans for the following query:
SELECT A.name
FROM Applicants A, Schools S, Major M
WHERE A.sid = S.sid AND A.id = M.id
AND A.city = 'Seattle' AND S.rank < 10 AND M.major = 'CSE'
Employee:
– Each tuple is 40 bytes long, 100 tuples per page, 1000 pages.
– Let’s say there are 100 employees.
• Department:
– Each tuple is 50 bytes long, 80 tuples per page, 500 pages.
– Let’s say there are 10 different departments.
No Indexes are available for both relations.
Compare the cost of two different query plans for the following query:
Select Fname, Dname from Employee e, Department d where e.dno = d.dnumber and salary
<180000;
Q.5 Set. (A) Consider an the application that tracks session management, serving ad content, or
for managing user and product profiles. Describe the schema required for the above
system using NoSQL database. Which NoSQL Database can be used?
Total : 8 marks
Q.5 Set. (B) Consider an the application like Twitter you store the user profile, their tweets and
the replies to their tweets. Also what all other tweets this user replied and some
recent tweets of the corresponding users. Note that user profile will have a set of
attributes, however, the set of attributes present might vary from one user to
another (e.g., some users won't provide DOB, where some user might not reveal
political affiliation, and so on).
Describe the schema required for the above system using NoSQL database. Which
NoSQL Database can be used? Total : 8 marks
Q.5 Set. (C) Consider an application that stores health tracker data and uses this data for further
prcessing.
Describe the schema required for the above application using NoSQL database.
Which NoSQL Database can be used? Total : 8 marks
******