0% found this document useful (0 votes)
17 views

Sample Final

Uploaded by

shravanmadhu45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Sample Final

Uploaded by

shravanmadhu45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Family Name: -----------------------------------------------------

Given Name: -----------------------------------------------------

Student ID: -----------------------------------------------------

University of Alberta
Faculty of Science

Fall 2000

CMPUT 291 – A1
File Structures and Data Management

Duration: 2 Hours
No Aids Allowed

QUESTION VALUE SCORE

1 14

2 27

3 10

4 17

5 16

6 16

TOTAL 100

Your examination booklet must have 8 pages (including this one).


CMPUT 291 / A1 Final Exam - Fall 2000 Page 2 of 8
Student name: Student ID: ______________

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

c) The result of a SQL statement cannot have duplicates.

( ) 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

f) Every BCNF relation is in 3NF.

( ) 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.

services (vin, vtype, srv-type, date, charge)


vehicles (vtype, make, model, year)

a) [6 marks] Give a SQL statement that creates view Service-History(make,


model, srv-freq, avg-charge) which contains for every make and model the
number of services and the average service charge.

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.

a) [5 marks] πsrv− type (σdate≥1 / 12 / 1999 services )


∧ date ≤ 31 / 12 / 1999

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}.

a) [3 marks] Show that ABC is a key.


CMPUT 291 / A1 Final Exam - Fall 2000 Page 6 of 8
Student name: Student ID: ______________

b) [3 marks] How many keys does the relation have? Justify.

c) [3 marks] Is the relation in BCNF? Explain.

d) [3 marks] Is the relation in 3NF? Explain.

e) [5 marks] Give a BCNF decomposition of the relation.


CMPUT 291 / A1 Final Exam - Fall 2000 Page 7 of 8
Student name: Student ID: ______________

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).

a) [ 3 marks ] Insert 33*, 44*.

b) [ 3 marks ] Insert 65*, 25*.

c) [ 3 marks ] Insert 100*, 50*.

d) [ 3 marks ] Insert 60*.

e) [ 4 marks ] Delete 25*, 35*.


CMPUT 291 / A1 Final Exam - Fall 2000 Page 8 of 8
Student name: Student ID: ______________

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.

a) [ 3 marks ] Insert 10*, 18*, 25*.

b) [ 3 marks ] Insert 36*, 9*.

c) [ 3 marks ] Insert 8*, 7*.

d) [ 3 marks ] Insert 26*, 3*.

e) [ 4 marks ] Delete 8*, 36*.

You might also like