Test your knowledge of DB2 9 by answering the questions below, which are from a real, previous DB2 9 Fundamentals certification exam (Exam 730). When you make your answer selection, click on "Get Answer" to check your answers and read the explanations. If you haven't done so already, be sure to take part 1, part 2, part 3, part 4 and part 5 of this DB2 9 quiz series about tables.

Sample Questions
Question 1
Which of the following tools can be used to automate table reorganization operations?
A. Control Center
B. Command Center
C. Command Line Processor
D. Task Center
Get answer

Question 2
Which of the following can NOT be used to restrict specific values from being inserted into a column in a particular table?
A. Index
B. Check Constraint
C. Refential Constraint
D. Default Constraint
Get answer

Question 3
A transaction using the Read Stability isolation level scans the same table multiple times before it terminates. Which of the following can occur within this transaction's processing?
A. Uncommitted changes made by other transactions can be seen from one scan to the next.
B. Rows removed by other transactions that appeared in one scan will no longer appear in subsequent scans.
C. Rows added by other transactions that did not appear in one scan can be seen in subsequent scans.
D. Rows that have been updated can be changed by other transactions from one scan to the next.
Get answer

Question 4
Which of the following will provide user USER1 and all members of the group GROUP1 with the ability to perform DML, but no other operations on table TABLE1?
A. GRANT INSERT, UPDATE, DELETE, SELECT ON TABLE table1 TO user1 AND group1
B. GRANT INSERT, UPDATE, DELETE, SELECT ON TABLE table1 TO USER user1, GROUP group1
C. GRANT ALL PRIVILEGES EXCEPT ALTER, INDEX, REFERENCES ON TABLE table1 TO USER user1, GROUP group1
D. GRANT CONTROL ON TABLE table1 TO user1 AND group1
Get answer

Question 5
Given the following table definitions:
TABLE1
¯¯¯¯¯¯¯¯¯¯¯
| ID | INT |
| NAME | CHAR(30) |
| PERSON | INT |
| CITIES | INT |
TABLE2
¯¯¯¯¯¯¯¯¯¯¯
Which of the following statements will remove all rows in table TABLE1 that have matching PERSONs in table TABLE2?
A. DELETE FROM table1 WHERE id IN (SELECT id FROM table2)
B. DELETE FROM table1 WHERE id IN (SELECT person FROM table2)
C. DELETE FROM table1 WHERE person IN (SELECT id FROM table2)
D. DELETE FROM table1 WHERE person IN (SELECT person FROM table2)
Get answer

Question 6
If the following SQL statements are executed:
CREATE TABLE tab1 (id SMALLINT NOT NULL PRIMARY KEY,
name VARCHAR(25));
CREATE TABLE tab2 (empid SMALLINT,
weekno SMALLINT,
payamt DECIMAL(6,2),
CONSTRAINT const1 FOREIGN KEY (empid)
REFERENCES taba(id) ON UPDATE NO ACTION);
Which of the following statements is true?
A. Only values that exist in the ID column of table TAB1 are allowed to be in-serted in the EMPID column of table TAB2
B. The updating of values in the ID column of table TAB1 is not allowed
C. Only values that do not already exist in the ID column of table TAB1 are al-lowed to be inserted in the EMPID column of table TAB2
D. When values that exist in the ID column of table TAB1 are updated, corre-sponding values in the EMPID column of table TAB2 are updated as well
Get answer

Question 7
Application A holds an Exclusive lock on table TAB1 and needs to acquire an Exclusive lock on table TAB2. Application B holds an Exclusive lock on table TAB2 and needs to acquire an Exclusive lock on table TAB1. If lock timeout is set to -1 and both applications are using the Read Stability isolation level, which of the following will occur?
A. Applications A and B will cause a deadlock situation
B. Application B will read the copy of table TAB1 that was loaded into memory when Application A first read it
C. Application B will read the data in table TAB1 and see uncommitted changes made by Application A
D. Application B will be placed in a lock-wait state until Application A releases its lock
Get answer

Question 8
A declared temporary table is used for which of the following purposes?
A. Backup purposes
B. Storing intermediate results
C. Staging area for load operations
D. Sharing result data sets between applications
Get answer

Question 9
Given the following data:
TAB1
C1 C2
--- ----
200 abc
250 abc
150 def
300 ghi
175 def
If the following query is executed:
WITH subset (col1, col2) AS
(SELECT c1, c2 FROM tab1 WHERE c1 > 150)
SELECT col2, SUM(col1) AS col1_sum
FROM subset
GROUP BY col2
ORDER BY col2
Which of the following result data sets will be produced?
A.| COL2 | COL1_SUM |
| -------- | -------- |
| abc | 200 |
| abc | 250 |
| def | 175 |
| ghi | 300 |
4 record(s) selected
B.
| COL2 | COL1_SUM |
| -------- | -------- |
| abc | 450 |
| def | 175 |
| ghi | 300 |
3 record(s) selected
C.
| COL2 | COL1_SUM |
| -------- | -------- |
| abc | 450 |
| def | 375 |
| ghi | 300 |
3 record(s) selected
D.
| COL2 | COL1_SUM |
| -------- | -------- |
| abc | 450 |
| abc | 450 |
| def | 175 |
| def | 175 |
| ghi | 300 |
5 record(s) selected
Get answer

Question 10
Given the following CREATE TABLE statement:
CREATE TABLE table2 LIKE table1
Which two of the following will NOT occur when the statement is executed?
A. TABLE2 will have the same column names and column data types as TABLE1
B. TABLE2 will have the same column defaults as TABLE1
C. TABLE2 will have the same nullability characteristics as TABLE1
D. TABLE2 will have the same indexes as TABLE1
E. TABLE2 will have the same referential constraints as TABLE
Get answer
