CIS 631 – Database Management Systems Sample Final Exam
1. (25 points) Match the items from the left column with those in the right and place the letters in the empty slots.
k 1. Single-level index files a. Unary relationship
x 2. Data Mining b. Unordered, ordered, and hashed
z 3. Closure Set algorithm c. Domain, key, foreign key
f 4. Internal Schema d. Not absolutely essential in a model
n 5. BCNF e. No independent primary key
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
o 9. Derived attribute i. Non-minimal primary key
w 10. Primary key j. Systematic examination of the functional
dependencies to establish the CK for the relation
s 11. Intersection relation k. Primary, Clustering , and Secondary
t 12. One-to-many relationship l. Same data to be modified in several places
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
r 15. ORDBMS o. Foreign key in either participating relation
b 16. Primary file organizations p. Non-PK attribute is the determinant of a Non-PK attribute
c 17. DB’s necessary integrity constraints q. Mandatory (full) participation
a 18. One-to-one relationship r. Allows handling of more complex data
y 19. Many-to-many relationship s. Relation that contains tuples common in both relations
m 20. Insertion anomaly t. PK of the parent entity placed in the child entity as FK
z 21. 3NF compliance u. Relation (s) consistent with the 2NF requirements
l 22. Update anomaly v. Dynamic structures that allow an index to expand and shrink
h 23. Serializeable schedule w. Cannot be NULL
g 24. Conflict in schedule x. Discovery of patterns and trends in the data
u 25. DB free of partial dependency y. Two foreign keys in a relationship table
e 26. Transitive dependency z. Eliminate partial and transitive dependencies
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 p
leaf= 3.
59
insert 59
59 o
59
23 o
insert 23
59 o
59
16 o
insert 16
23 o 59 o
28 59
16 o 23 o 28 o
insert 28
59 o
…
3. (10 points) Given the following schedule:
S1: r
2(X); r
1(Y); w
2(X); r
3(X); w
1(Y); w
3(X); r
2(Y); w
2(Y);
a. Is S1 serializable? If yes, what is the serialized schedule like? Demonstrate your work with a precedence graph.
This is not serializable because of the following cycle.
1 2 3
b. (10 points) Given the following schedule:
S2: r
2(X); r
1(Y); w
2(X); r
2(Y); r
3(X); w
1(Y); w
3(X); w
2(Y);
Is S2 serializable? If yes, what is serialized schedule like? Demonstrate your work with a precedence graph.
This is not serializable because of the following cycle.
1 2 3
(Next 10 points are worth 2 points each)
4. Which of the following statements is false?
a. The data on secondary storage persists through power loss.
b. The primary memory is not large or reliable enough to store the quantity of data a typical database might require.
c. The data stored in primary storage is not lost when power is lost.
d. Access time for primary storage is much faster than the secondary storage.
5. Which of the following does not correspond to a file organization?
a. Hash b. Heap c. ISAM d. Sorted
6. Which of the following is false about heap files?
a. A heap file has no particular ordering with respect to a field value.
b. A linear search must be performed to access a record in a heap file.
c. Heap files are best for bulk loading data into a table.
d. When a record is deleted, the space is reused when inserting the next record.
7. Which of the following statements is true about a sorted file?
a. Inserting and deleting records in a sorted file is easy.
b. Ordered files are rarely used for DB storage unless a primary index is added to the file.
c. When a record is inserted in a sorted file, it is placed at the end of the file.
d. In general a linear search is more efficient than a binary search.
8. Which of the following statements is false about hash files?
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.
9. Which of the following statements is false?
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.
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.
11. Which of the following is true?
a. seek time + rotational latency = transfer time + access time b. seek time + rotational latency + transfer time = access time c. seek time + rotational latency + access time = transfer time d. seek time = rotational latency + transfer time + access time
12. Match the following:
a. Seek time b a. Time to move to the desires block b. rotational time a b. Time to move to the desired track
c. Transfer time d c. Time to move to the block, track, and exchange d. Access time c d. Time to read or write the data in the block
13. Match the following:
a. RAID level 0 b a. Uses block-level data striping across all disks
b. RAID level 1 c b. Lowest reliability and possibility of data loss
c. RAID level 3 d c. Improved read and slightly lower write performance
d. RAID level 5 a d. Improved read but poor write performance
11. (20 points) Given the Employee table, answer the following questions:
EmpID Dept Salary HireDate SupervisorID
1001 Finance 10000 01-Nov-98 1020
1002 Finance 15000 12-Dec-96 1020
1020 Finance 30000 09-Feb-93 1035
1015 Human Resources 20000 15-Mar-01 1045
1008 Operations 9000 22-Aug-97 1013
1010 Operations 12000 09-Jul-01 1013
1035 Operations 40000 14-Sep-95 1000
1007 Maintenance 5000 07-Oct-01 1017
1050 Human Resources 10000 05-Apr-98 1045
1000 Executive 60000 25-Nov-93
1016 Human Resources 11000 13-Oct-01 1045
Q1. Which employee ID would be returned in the output given the following query on the Employee table?
SELECT empID, dept, salary FROM employee outer
WHERE salary > (SELECT min(salary) FROM employee inner
WHERE inner.dept = outer.dept);
a. 1020, 1015, 1035, 1007, 1000 b. 1020, 1015, 1035
c. 1000
d. 1001, 1050, 1008, 1007, 1000 e. 1002, 1020, 1015, 1010, 1035,1016
Q2. Which statements will delete all employees from the Finance department who make less than $20,000 and hired during the year 2001?
a. DELETE FROM employee WHERE dept = ‘Finance’
AND salary < 20000
AND hiredate BETWEEN ’01-jan-01’ AND ’31-dec-01’;
b. DELETE FROM employee WHERE dept = ‘Finance’
AND salary < 20000
AND hiredate >= ’01-jan-01’ AND hiredate <= ’31-dec-01’;
c. DELETE FROM employee dept = ‘Finance’
AND salary < 20000
AND hiredate >= ’01-jan-01’ AND hiredate <= ’31-dec-01’;
d. DELETE FROM employee WHERE dept = ‘Finance’
AND salary < 20000
hiredate >= ’01-jan-01’ AND hiredate <= ’31-dec-01’;
Q3. Which answer best describes the following query?
SQL> SELECT empID, dept 2 FROM employee
* WHERE salary IS NOT NULL and ROWNUM<5;
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.
Q4. Which answer best describes the following query?