Академический Документы
Профессиональный Документы
Культура Документы
Final Examination
Semester 1 (2006)
I Duration: 3 Hours I
Instruction to Candidates:
• This paper has 5 questions. Answer All Questions.
• Total Marks - 100.
• Number of Questions - 5
• This paper contains 5 pages with Cover Pager.
ADVANCED DATABASE MANAGEMENT SYSTEMS - 540
SEMESTER 1, 2006
Question 1
Marks: 20 marks
Approx. Time: 30 minutes
(a.) Consider the following relational schema. An employee can work in more than
one department; the pet_time field of the Works relation shows the percentage of
time that a given employee works in a given department.
.----
Works( eid:integer. did:integer , pet _time: integer)
Write an SQL statement to find out the total percentage of time worked by each
manager. Print the manager id and total percentage worked.
(10 marks)
Tables:
Dept of Dept_t(dname primary key, manager references Emp)
Emp of Emp _t(ename primary key) nested table works
Write an Oracle Object SQL statement to find out the total percentage of time
worked by each manager. Print the name of manager and total percentage worked.
Use OR feature that you have learnt wherever possible.
(10 marks)
Page 1 of4
Question 2
Marks: 25 marks
Approx. Time: 40 minutes
Frame
Dirtv:
PinCount
Frame No: 0 PageID:
PageID: No:'4
15120123I
Dirtv: 01No:
PinCount: 40
Each frame has a frame number (Frame No), page id (page/D) of page inbu~l,
pin count (PinCount) and a dirty bit (Dirty).
Assume that CLOCK replacement policy is used and the clock hand moves from
frame 0-4. The current clock hand is at frame 3. Describe the steps involved{~ \1(1
page request for the page with PageID 100 is received by the buffer managerr
(10 marks)
Question 3
Marks: 25 marks
Approx. Time: 40 minutes
(a.) Briefly explain reasons as to why using index scans to access files may not
always be advantageous for selections when compared to file scans.
(lOmarks)
(b.) What is the main advantage of hash indexes over B+ tree indexes?
(5 marks)
(c.) Briefly explain the main advantage of using heuristics in query optimization?
(5 marks)
(d.) Briefly explain why cost-based optimization techniques are used in query
optimization? ,
;." (5 mar~s)
Page 2 of4
Question 4
Marks: 15 marks
Approx. Time: 30 minutes
Estimate the cost (in Disk liDs) of executing Query 1with the following indexes.
i. Unc1ustered hash index on Student<sid>
ii.· Clustered hash index on Student<sid>
The data entries in the index have <k, rid> format. Hash indexes require 1.2 Disk
I/Os on average to retrieve a data entry. B+ tree indexes require 3 disk liDs to
retrieve a leaf page.
(4 marks)
Estimate the cost (in Disk liDs) of executing Query 2 with the following indexes.
i. Unc1ustered B+ tree index on Student<gpa>
ii. Clustered B+ tree index on Student<gpa>
Assume that 0.5% of tuples meet the selection criteria (gpa = 3.0). The data
entries in the index have <k, rid> format and 20% the size of the actual record.
Hash indexes require 1.2 Disk liDs on average to retrieve a data entry. B+ tree
indexes require 3 disk liDs to retrieve a leaf page.
(6 marks)
Page 3 of4
(c.) Consider the, following BCNF relations which describe employees •andth'eir
working departments. 1 "
Suppose that after you have created indexes, updated statistics and the performance
is still not satisfactory. Since, you cannot afford to buy new hardware you have to
consider a schema redesign.
Explain how you would try to obtain better performance by describing the schema
of relation( s) that you would use and the choice of indexes on these relations.
(5 marks)
Question 5
Marks: 15 marks
Approx. Time: 30 minutes
Briefly explain a ConcUlTency Control Protocol that you have studied and describe how it
avoids conflicts that cause anomalies.
(15 marks)
Page 4 of4