Sample Final
Sample Final
University of Alberta
Faculty of Science
Fall 2000
CMPUT 291 – A1
File Structures and Data Management
Duration: 2 Hours
No Aids Allowed
1 14
2 27
3 10
4 17
5 16
6 16
TOTAL 100
Question 1
[ 14 marks in total ] TRUE or FALSE: 2 marks for each correct answer; -2 marks for
each incorrect answer; 0 mark if no choice is selected.
a) In an ER diagram, the relationship between an owner entity set and a weak entity set
can only be one-to-many with the total participation of the weak entity set.
( ) TRUE ( ) FALSE
b) Integrity constraints can be inferred for a given relational schema by examining its
instances.
( ) TRUE ( ) FALSE
( ) TRUE ( ) FALSE
d) The SQL query “SELECT name FROM customers WHERE city <> ‘Ottawa’” will
not list any customer whose city field is NULL.
( ) TRUE ( ) FALSE
e) Armstrong axioms are complete meaning that for a given set F of FD’s the axioms can
only generate functional dependencies that are logically implied from F.
( ) TRUE ( ) FALSE
( ) TRUE ( ) FALSE
g) For equality queries, B+ trees are faster than hash-based indexes in the average case.
( ) TRUE ( ) FALSE
CMPUT 291 / A1 Final Exam - Fall 2000 Page 3 of 8
Student name: Student ID: ______________
Question 2
[ 27 marks in total ] The following schema describes information about service histories
of vehicles (for example in a garage). A tuple (v, t, s, d, c) in services means that the
vehicle with VIN v of type t is serviced with service type s on day d and the service is
charged c dollars and cents. The vehicles relation gives for each vehicle of type t, its
make (e.g. Honda), model (e.g. Accord) and the year of the vehicle.
b) [5 marks] Using view Service-History, give a SQL statement that lists the make
and the model of vehicles with the fewest number of services.
CMPUT 291 / A1 Final Exam - Fall 2000 Page 4 of 8
Student name: Student ID: ______________
c) [5 marks] Using view Service-History, give a SQL statement that lists the number
of services for every make of vehicles.
d) [5 marks] Give a SQL statement that lists service types that have never been
charged over $100.
e) [6 marks] Give a SQL statement that lists for every make and model of vehicles
the most common service type.
CMPUT 291 / A1 Final Exam - Fall 2000 Page 5 of 8
Student name: Student ID: ______________
Question 3
[ 10 marks in total ] Using the schema given in Question 2, explain in plain English what
the following relational algebra queries compute.
b) [5 marks] πmake, mod el , year ( vehicles >< (πvtypevehicles − πvtype (σdate≥1 / 1 / 2000 services))
Question 4
[ 17 marks in total ] Consider relation R with attributes ABCDE and functional
dependencies {ABàD, BCàE}.
Question 5
[ 16 marks in total ] Consider a B+ tree in which an internal node can hold up to 3 keys and a
leaf can hold up to 2 records. Starting from an empty tree, perform the following operations in
the given order (show the final tree in each part).
Question 6
[ 16 marks in total ] Starting from an empty extendible hash file, perform the following
operations in the given order. Show the result including all indicators after each part. Assume a
page can hold up to 3 records.