CIS 631 Database Management Systems Sample Final Exam
CIS 631 Database Management Systems Sample Final Exam
i 6. Super key f. The structure of the stored data and related retrieval
schema
e 7. Weak entity type g. Successive read/write of the same data from two
different transactions
a 8. Recursive relationship h. Interleaved schedule equivalent of a serial
q 13. Minimum cardinality of one m. The new tuple cannot be inserted in a relation based
on the current relation schema
v 14. B-trees and B+ trees n. Every determinant is a candidate key
1
2. (15 points) Insert the following key values: 59, 23, 16, 28, 10, 1, 70, 79, 12, 19, 29, 72, 53, 45, and 90
into an initially empty B+-Tree in the given order. Suppose the orders of the B+-Tree are p = 4 and pleaf = 3.
insert 59
59
59 o
59 insert 23
23 o 59 o
59 insert 16
16 o 23 o 59 o
28 59 insert 28
16 o 23 o 28 o 59 o
2
3. (10 points) Given the following schedule:
a. Is S1 serializable? If yes, what is the serialized schedule like? Demonstrate your work with a
precedence graph.
1 2 3
Is S2 serializable? If yes, what is serialized schedule like? Demonstrate your work with a
precedence graph.
1 2 3
3
(Next 10 points are worth 2 points each)
a. Hash
b. Heap
c. ISAM
d. Sorted
a. A hash function calculates the address of the page on which the record is to be stored.
b. Each address generated by a hashing function corresponds to a page(bucket)
c. A hash function is chosen so that records are not evenly distributed in the table.
d. Several records can be placed in a bucket in order of arrival.
a. The values in the index file are ordered according to the indexing field.
b. Primary index corresponds to a sequentially ordered data file and indexing field a key
field of the file.
c. Clustering index corresponds to a sequentially ordered data file and indexing field not
a key field of the file.
d. Secondary index corresponds to an index that is defined on an ordering field of the data
file.
4
10. Which of the following is not a B+-Tree rule?
a. If the root is not a leaf node, it must have at least two children.
b. The # of key values contained in a non-leaf nodes is 1 less than the number of pointers.
c. Different paths from root to leaves must have different lengths.
d. Leaf nodes are linked in order of key values.
5
11. (20 points) Given the Employee table, answer the following questions:
Q1. Which employee ID would be returned in the output given the following query on the Employee table?
Q2. Which statements will delete all employees from the Finance department who make less than $20,000
and hired during the year 2001?
6
Q3. Which answer best describes the following query?
a. Output will contain, empID and dept for any 5 employees who have salary data.
b. Output will contain, empID and dept for any all employees who have salary data.
c. Output will contain, empID and dept for any 5 employees who have no salary data.
d. Output will contain, empID and dept for any 4 employees who have salary data.
e. Output will contain, empID and dept for any 4 employees who have no salary data.
a. Output will contain, empID and dept for any 2 who have no SupervisorID data.
b. Output will contain, empID and dept for any employee who has no SupervisorID data.
c. Output will contain, empID and dept for any employee whose SupervisorID data is zero.
d. Output will contain, empID and dept for any 2 employees whose SupervisorID data is zero.
e. Output will contain, empID and dept for any 2 employees whose SupervisorID data IS NULL.
7
Q6. Which of the following queries will select the name and average salary for all departments that satisfy
the following conditions:
- include all departments EXCEPT Human Resources
- average salaries greater than $10,000
- sort by department name
-
ID RATE
---------- ----------
101 10
102 20
103
104 10
105 20
What is the output of the following query? SELECT AVG(Rate) FROM emp_hr;
a. NULL
b. 12
c. 15
d. 10
e. 20
8
Q8. Given the following SELECT statement,
ID RATE
---------- ----------
101 10
102 20
103
104 10
105 20
What is the output of the following query? SELECT AVG(NVL(Rate, 0))FROM emp_hr;
a. NULL
b. 12
c. 15
d. 10
e. 20
Q9. Which line of the following SELECT statement contains an error, if any?
a. 1
b. 2
c. 3
d. 4
e. No error
a. COUNT
b. AVG
c. TOTAL
d. SUM
e. MIN
f. MAX
Your Answer: