You are on page 1of 2

Write down if following statements are correct or incorrect.

For those that are incorrect explain why they are not
correct.

1. An operation consists of a sequence of query and/or update statements.


a) Transaction

2. Commit makes the transaction permanent in the database.

true

3. In case of any shut down during transaction before commit, undo is done automatically ?

c) Rollback

4. Atomicity ensures that once transaction changes are done, they cannot be undone or lost, even in the event
of a system failure.

A. Durability

5. Isolation means that the data used during the execution of a transaction cannot be used by a second
transaction until the first one is completed.

True (10 marks)

1. Explain what is sparse index and dense index

Ans:
Sparse - contains index records for only some search-key values.
Dense - Index record appears for every search-key value in the file.
(2 marks)

2. Specify an advantage and disadvantage of sparse index files

Adv:
Less space and less maintenance overhead for insertions and deletions.

Disadv:
Generally slower than dense index for locating records.
Applicable when records are sequentially ordered on search-key

(2 marks)

3. Explain properties of a B+ tree’s leaf node and non leaf node.


(6 marks)

Properties of a leaf node: (1 mark for each point)


 For i = 1,2,…, n-1, pointer Pi either points to a file record with search-key value Ki, or to a bucket of
pointers to file records, each record having search-key value Ki. Only need bucket structure if search-
key does not form a primary key.
 If Li, Lj are leaf nodes and i < j, Li’s search-key values are less than Lj’s search-key values
 Pn points to next leaf node in search-key order
Non leaf nodes form a multi-level sparse index on the leaf nodes. For a non-leaf node with m pointers:
(1 mark for each point)
 All the search-keys in the subtree to which P1 points are less than K1
 For 2 ≤i ≤n –1, all the search-keys in the subtree to which Pi points have values greater than or equal to
Ki–1and less than Ki
 All the search-keys in the subtree to which Pn points have values greater than or equal to Kn–1

4. You are asked to develop a database system for an airline reservation system.
A. Determine 3 possible errors that could occur if multiple users are accessing the system at
the same time. Give suitable examples to illustrate the errors considering the scenario given
above.

4 marks each – 1 mark for naming the problem and 3 marks for example
 Lost Update Problem
 Temporary Update/Dirty Read
 Incorrect Summary
 Unrepeatable read
(12 marks)

B. In the above database there is a table named Booking with following details.
Create table Booking (bookingId, PassengerName, flightNo, ArrivalPort, DeparturePort)

BookingId is the primary key.

Identify suitable columns to use B+tree and Bitmap index. Give your reasons.
(8 marks)

BookingId – B+ tree ( 2 marks)


 reduces the time to search through the index values – as cardinality is 1 (no
duplicates), no benefit of using bitmap index.

PassengerName (2 marks)

 if no (or less) duplicates – no benefit of using bitmap index.


 Suggest any other index other than bitmap index

flightNo (2 marks)
 Use Bitmap index
 As cardinality is less than 1 (has duplicate values)

ArrivalPort/DeparturePort (2 marks)
 Use Bitmap index
 As cardinality is less than 1 (has duplicate values)

You might also like