Professional Documents
Culture Documents
NEWCASTLE UNIVERSITY
SEMESTER 2 2013/14
DATABASE TECHNOLOGY
Instructions to candidates:
Answer ONE question from Section A
Answer ONE question from Section B
Write each answer in a SEPARATE answer book
The total marks available for this exam are 100
Marks shown for sub-sections are indicative only
[Turn Over]
[CSC2024]
SECTION A
Answer ONE question in this section
Question 1
a) Define the following terms:
i)
Entity
[5 marks]
ii) Attribute
[5 marks]
iii) Relationship
[5 marks]
[CSC2024]
menu), a price, a topping and a type of crust. You may
assume that an order may contain multiple pizzas. It is
possible that an order contains a request for more than
one of the same type of pizza; therefore it is necessary
to not just indicate which pizzas are required in an
order but also the quantity. Draw an entity-relationship
diagram which illustrates this information. IMPORTANT
NOTE if you wish to incorporate any entities in this
diagram which you first introduced in part i) of this
question and which you have not altered in this new
diagram, you do not need to show all the attributes of
these entities again.
[7 marks]
iii) Finally, the shop decides to extend the database further
by including details of the deliveries required to
transport the cooked orders to their destination. Orders
now need to be associated with a delivery you may
assume that an order will only occupy one delivery.
However, one delivery may contain multiple orders
being sent to different customers. The shop needs to
know the date and start time of each delivery and the
approximate distance it will cover. They also need to
record the ID number of the staff member making the
delivery. Again, no further staff details are required.
Draw an entity-relationship diagram which illustrates
this information. IMPORTANT NOTE if you wish to
incorporate any entities in this diagram which you first
introduced in part i) or part ii) of this question and which
you have not altered in this new diagram, you do not
need to show all the attributes of these entities again.
[9 marks]
c) When creating a database based on an entity-relationship
model, a table must be created for every strong entity in the
Page 3 of 10
[CSC2024]
entity-relationship
relationships too.
i)
diagram
and
for
some
of
the
CustName
CustAddress
Page 4 of 10
[CSC2024]
Reservations
CustNo
TourID
Tours (note that time is the start time and duration the
length of the tour in hours).
TourID
Theme
Date
Time
Duration
Price
Page 5 of 10
[CSC2024]
viii) For all customers, list their customer number, name,
themes of tours they have attended and the dates they
attended.
[3 marks]
ix) There is a half-price offer on tour T007 where the
customer pays half the price shown in the database.
Display the price that the customer actually pays.
[2 marks]
c) Consider again the schema from part b) above.
i)
Page 6 of 10
[CSC2024]
SECTION B
Answer ONE question in this section
Question 1 (Transaction management).
a) Define the following terms, in the context of database
transaction management:
i)
Atomicity
[3 marks]
ii) Consistency
[3 marks]
iii) Isolation
[3 marks]
T1
T2
R(y)
W(y)
T3
200
R(z)
R(Y)
R(x)
W(x)
20
R(y)
W(y)
W(z)
10
R(y)
11
R(x)
12
Commit
13
14
Rollback
CRASH
Page 7 of 10
300
2000
[CSC2024]
i)
Page 8 of 10
[CSC2024]
Question 2 (index management)
Consider a data file consisting of 50K records of fixed size
128B, which are stored in 2KB blocks.
The records are ordered on the value of a key field X.
The records also contain a non-key field Y. The values for X
have fixed size 64B. The values for Y have fixed size 32B.
a) Explain the difference between dense and nondense
(sparse) index. Explain under which conditions each type
can be used.
[6 marks]
b) Calculate:
i)
[CSC2024]
iii) The average number of block reads required for a
binary search in the index
[8 marks]
d) What operations are required on the data file and on each
of the index files when a new record is inserted into the
database?
[4 marks]
Page 10 of 10