You are on page 1of 6

F2 Slot - KEY

1. [CO2]
SET A
Consider the below schema.
Sailors (sid, sname, rating, age)
Reserves ( sid, bid, day, rname)
Each tuple of Reserves is 20 bytes long, that a page can hold 100 Reserves tuples and
500 pages are used to store Reserves tuples.
Each tuple of Sailors is 10 bytes long, that a page can hold 200 Sailors tuples and 300
pages are used to store Sailors tuples.
They are stored in distributed DBMS with all Sailors stored at Chennai and all
Reserves at Bangalore.
Consider the query:
Select * from Sailors S, Reserves R where S.sid = R.sid.
Find the cost of answering this query using each of the following plane.
a. Compute the query at Chennai using page oriented nested loop joins. [3]
b. Compute the query at Bangalore using sort merge join. [3]
c. Compute the query at Hyderabad by moving both relations to Hyderabad and
using a sort merge join. [4]
ANSWER:
a. 500td+(500*300)(td+ts) = 500td+150000 (td+ts)
b. 300(2td+ts)+3(300+500)td = 300(2td+ts)+2400td
c. 300(2td+ts)+500(2td+ts)+2400td

SET B

Consider the below schema.


Sailors (sid, sname, rating, age)
Reserves ( sid, bid, day, rname)
Each tuple of Reserves is 30 bytes long, that a page can hold 200 Reserves tuples and
700 pages are used to store Reserves tuples.
Each tuple of Sailors is 20 bytes long, that a page can hold 300 Sailors tuples and 300
pages are used to store Sailors tuples.

Page 1 of 6
They are stored in distributed DBMS with all Sailors stored at Chennai and all
Reserves at Bangalore.
Consider the query:
Select * from Sailors S, Reserves R where S.sid = R.sid.
Find the cost of answering this query using each of the following plane.
a. Compute the query at Bangalore using page oriented nested loop joins. [3]
b. Compute the query at Chennai using sort merge join. [3]
c. Compute the query at Hyderabad by moving both relations to Hyderabad and
using a sort merge join. [4]
Answer:
a. 700td+(700*300)(td+ts) = 700td+210000 (td+ts)
b. 700(2td+ts)+3(700+300)td = 700(2td+ts)+3000td
c. 300(2td+ts)+700(2td+ts)+3000td

2.
[CO2]
SET A
Consider a parallel DBMS in which each relation is stored by horizontally partitioning its
tuples across all disks.

Patient (pid: integer, pname: char, did: integer, patient_bill: real)


Doctor(did: integer, dname: integer, salary: real, dept: char)

Each relation contains 20-byte tuples, and the patient_bill and salary fields both
contain uniformly distributed values in the range 0 to 1,000,000. The patient relation
contains 100,000 pages, the Doctor relation contains 5,000 pages, and each processor
has 100 buffer pages of 4,000 bytes each. Consider there are 10 processors and shared
nothing architecture is followed.

a. In order to find the patient who has paid bills with an exact value of Rs.40000, what
data partitioning technique should be used? Justify. [5]

Page 2 of 6
ANSWER: Hash Partitioning is best since exact value is used, the system can
exactly go to the specified disk.
b. To load equal number of tuples in all the 10 disks what data partitioning methods
can be used? Justify. [5]
ANSWER: Round Robin is better without any further condition to load equal
number of tuples.

SET B
Consider a parallel DBMS in which each relation is stored by horizontally partitioning its
tuples across all disks.

Employee (EmployeeID, EName, Salary, Department, Poistion, JoiningDate)

Sports (EmployeeID, Sports)

Salary field contain uniformly distributed values in the range 10000 to 2,00,000. The
employee relation contains 500 pages, the sports relation contains 100 pages, and each
processor has 100 buffer pages of 4,000 bytes each. Consider there are 10 processors
and shared nothing architecture is followed.

a. In order to find the employees who have been paid salary in the range 50000 and
1,00,000, what data partitioning technique should be used? Justify. [5]
ANSWER: Range partitioning is best.
b. To display the sports played by the employees in HR department, suggest a joining
technique. [5]

Page 3 of 6
3.
[CO1]

SET A
Symphonic Band is an orchestra that plays different types of concerts. The orchestra’s
popularity is growing fast and they are starting to have problems to keep track of the
musicians that should play in each concert as well as the musical works that are most
suitable for the concert. Help the orchestra to create a database model, as a first step to
implement a database, so that the orchestra can keep track of both musicians and musical
works. The database model must represent the following points:
 The orchestra plays three types of concerts: church concerts, private parties, and
outdoor concerts.
 The orchestra plays three types of music: classical, popular, and american folk. The
orchestra always plays classical music in their church concerts. The orchestra
always plays american folk on private parties. Finally, the orchestra plays a blend
of the three types of music when playing outdoor.
 It should be possible to find in the database the music works that are suitable for
each type of concert so that the repertoire can be easily planned well in advance.
 For each musical work, the database should store which musical setting (i.e. The
instruments) are required to play the work.
 The database should store information for each coming concert. The information
should include the place, date and time of the concert as well as the type of concert
and the repertoire that will be played.
 For each musician in the orchestra, the database should store his/her name, the
instrument that he/she plays, and in which of the coming concerts he/she will
participate.
Draw an EER diagram for the orchestra’s database.

Page 4 of 6
SET B
The club Travel-Often-And-A-Lot organises shorter and longer tours for its members. Help
them make a model of their mini world.
Travel-Often-And-A-Lot has members. Each member is represented by her/his full name,
address, and birth date. Some members belong to the board of Travel-Often-And-A-Lot.
Some members are organizers (of tours). Organizers must be stored with their cell phone
number so that they can be reached anytime. Organizers organize tours. Sometimes a tour
is organized by several organizers. Each tour is denoted by a name, e.g. “Museums of Paris,
2004” or “Iceland, 2005”. Tours can take place multiple times. “Museums of Paris, 2004”,
for instances, takes place twice: May 22nd to May 29th, 2004 and June 5th to June 12th,
2004. The cost of a tour depends on the date, e.g. “Museums of Paris, 2004” was cheaper
in May than in June. Each travel – such as “Museums of Paris, 2004” at June 5th to June
12th, 2004 – is lead by one organizer. Members participate in travels. Travel-Often-And-
A-Lot wants to keep track of the payments made by its members. A payment can e.g. be
the annual club fee, a donation, etc. but also the payment for a travel. Mind the subtle
distinction between tour and travel.
Draw the EER-diagram for this mini world description.

Page 5 of 6
Page 6 of 6

You might also like