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 and part 3 of this DB2 9 quiz series about tables.

Sample Questions
Question 1
Which of the following deletion rules on CREATE TABLE will allow parent table rows to be deleted if a dependent row exists?
A. ON DELETE RESTRICT
B. ON DELETE NO ACTION
C. ON DELETE SET NO VALUE
D. ON DELETE CASCADE
Get answer

Question 2
To which of the following resources can a lock NOT be applied?
A. Table spaces
B. Buffer pools
C. Tables
D. Rows
Get answer

Question 3
Given the following SQL statements:
CREATE TABLE tab1 (col1 INTEGER)
INSERT INTO tab1 VALUES (NULL)
INSERT INTO tab1 VALUES (1)
CREATE TABLE tab2 (col2 INTEGER)
INSERT INTO tab2 VALUES (NULL)
INSERT INTO tab2 VALUES (1)
INSERT INTO tab2 VALUES (2)
What will be the result when the following statement is executed?
SELECT * FROM tab1 WHERE col1 IN (SELECT col2 FROM tab2)
A. COL1
1
1 record(s) selected
B. COL1
NULL
1
2 record(s) selected
C. COL1
-
1
1 record(s) selected
D. COL1
-
1 record(s) selected
Get answer

Question 4
Given the statement:
CREATE TABLE tablea ( col1 INTEGER NOT NULL,
CONSTRAINT const1 CHECK (col1 in (100, 200, 300))
Which of the following can be inserted into TABLEA?
A. 0
B. NULL
C. 100
D. '100'
Get answer

Question 5
Given the following two tables:
TAB1
COL_1 COL_2
A 10
B 12
C 14
TAB2
COL _A COL_B
A 21
C 23
D 25
Assuming the following results are desired:
COL _1 COL_2 COL_A COL_B
A 10 A 21
B 24 - 21
C 14 C 21
- - D 25
Which of the following joins will produce the desired results?
A. SELECT * FROM tab1 INNER JOIN tab2 ON col_1 = col_a
B. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON col_1 = col_a
C. SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON col_1 = col_a
D. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON col_1 = col_a
Get answer

Question 6
Application A holds a lock on a row in table TAB1. If lock timeout is set to 20, what will happen when Application B attempts to acquire a compatible lock on the same row?
A. Application B will acquire the lock it needs
B. Application A will be rolled back if it still holds its lock after 20 seconds have elapsed
C. Application B will be rolled back if Application A still holds its lock after 20 seconds have elapsed
D. Both applications will be rolled back if Application A still holds its lock after 20 seconds have elapsed
Get answer

Question 7
A view named V.VIEW1 is based on a table named T.TABLE1. A user with DBADM authority issues the following statement:
GRANT INSERT ON v.view1 TO user1 WITH GRANT OPTION
Which of the following statements is USER1 authorized to execute?
A. GRANT INSERT ON t.table1 TO user2
B. GRANT CONTROL ON v.view1 TO user2
C. GRANT ALL PRIVILEGES ON v.view1 TO user2
D. GRANT INSERT ON v.view1 TO user2
Get answer

Question 8
Given the following CREATE TABLE statement
CREATE TABLE EMPLOYEE
(EMPNO CHAR(3) NOT NULL,
FIRSTNAME CHAR(20) NOT NULL,
MIDINIT CHAR(1),
LASTNAME CHAR(20) NOT NULL,
SALARY DECIMAL(10, 2))
Which of the following will retrieve the rows that have a missing value in the MIDINIT column?
A. SELECT * FROM employee WHERE midinit = ' '
B. SELECT * FROM employee WHERE midinit = NULL
C. SELECT * FROM employee WHERE midinit = " "
D. SELECT * FROM employee WHERE midinit IS NULL
Get answer

Question 9
Given the following table:
STOCK
CATEGORY CHAR(1)
PARTNO CHAR(12)
DESCRIPTION VARCHAR(40)
QUANTITY INTEGER
PRICE DEC(7,2)
If items are indicated to be out of stock by setting DESCRIPTION to NULL and QUANTITY and PRICE to zero, which of the following statements updates the STOCK table to indicate that all items except those with CATEGORY of 'S' are temporarily out of stock?
A. UPDATE stock SET description = 'NULL', quantity = 0, price = 0 WHERE category <> 'S'
B. UPDATE stock SET description = NULL, SET quantity = 0, SET price = 0 WHERE category <> 'S'
C. UPDATE stock SET (description, quantity, price) = ('null', 0, 0) WHERE category <> 'S'
D. UPDATE stock SET (description, quantity, price) = (NULL, 0, 0) WHERE category <> 'S'
Get answer

Question 10
Which of the following DB2 UDB isolation levels will only lock rows during read process-ing if another transaction tries to drop the table the rows are being read from?
A. Repeatable Read
B. Read Stability
C. Cursor Stability
D. Uncommitted Read
Get answer
