Вы находитесь на странице: 1из 5

I

Sri Lanka Institute of Information Technology

M.Sc. in Information Technology

Final Examination
Semester 1 (2006)

Advanced Database Management Systems


(540)

I Duration: 3 Hours I

Sunday, 19th November 2006


(Time 9.00 a.m. - 12.00 noon)

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

ANSWER ALL QUESTIONS


TIME: 3 Hours (including 10 minutes reading time)
MARKS: 100

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.

Emp(eid: integer, ename: string, age: integer, salary:real)


~
.•..•......

.----
Works( eid:integer. did:integer , pet _time: integer)

Dept(did:integer, dname: string; budget: real, managerid: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)

(b.) Consider the equivalent OR schema:


Types:
Dept_t (dname: string; budget: real, manager: REF Emp_t)
Works_t (dept: REF Dept_t,pct_time: integer)
- -
Works ntab t as nested table of Work - t
Emp_t (ename: string, age: integer, salary:real, works: Works_ntab_t)

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

(a) Briefly explain 3 components of a DBMS and their functionality

(c.) Consider the following the buffer pool with 5 frames.

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

Consider the following relation:


Student( sid:char{ 10), sname:varchar( 100), address:varchar(200), gpa: float)
The relation has 10000 pages with 100tuples per page.

-Ca.) Consider the following query on Student relation above:


Query 1: SELECT * FROM Student WHERE sid = 'DITOOOl'

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)

(b.) Consider the following query on above Student relation:


Query 2: SELECT * FROM Student WHERE gpa = 3.0;

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 "

Emp( eid, enarne, sal, did)


Dept(did, dnarne, location, budget)
The did attribute of Emp relation is a foreign key referring to did attribute of Dept
relation.

Consider the following query:


Find the name of department (i.e. dname) where a user-specified employee works

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

Вам также может понравиться