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

Sample Questions
Question 1
Which of the following isolation levels will lock all rows scanned to build a result data set?
A. Uncommitted Read
B. Cursor Stability
C. Read Stability
D. Repeatable Read
Get answer

Question 2
Which of the following is a NOT a valid reason for defining a view on a table?
A. Restrict users' access to a subset of table data
B. Ensure that rows inserted remain within the scope of a definition
C. Produce an action as a result of a change to a table
D. Provide users with an alternate view of table data
Get answer

Question 3
Which of the following is NOT a characteristic of a declared temporary table?
A. Declared temporary tables are not persistent and can only be used by the application that creates them
B. It is possible for many applications to create declared temporary tables that have the same name
C. Declared temporary tables are created by executing a CREATE TABLE statement with the DECLARED GLOBAL TEMPORARY clause specified
D. Once the application that created a global temporary table is terminated, any records in the table are deleted and the table is automatically destroyed
Get answer

Question 4
After the following SQL statement is executed:
GRANT ALL PRIVILEGES ON TABLE employee TO USER user1
Assuming user USER1 has no other authorities or privileges, which of the following actions is user USER1 allowed to perform?
A. Drop an index on the EMPLOYEE table
B. Grant all privileges on the EMPLOYEE table to other users
C. Alter the table definition
D. Drop the EMPLOYEE table
Get answer

Question 5
Given the following table definition:
EMPLOYEES
¯¯¯¯¯¯¯¯¯¯¯
| EMPID | INTEGER |
| NAME | CHAR(20) |
| DEPT | CHAR(10) |
| SALARY | DECIMAL(10,2) |
| COMMISSION | DECIMAL(8,2) |
Assuming the DEPT column contains the values 'ADMIN', 'PRODUCTION', and 'SALES', which of the following statements will produce a result data set in which all ADMIN department employees are grouped together, all PRODUCTION department employees are grouped together, and all SALES department employees are grouped together?
A. SELECT name, dept FROM employees ORDER BY dept
B. SELECT name, dept FROM employees GROUP BY dept
C. SELECT name, dept FROM employees GROUP BY ROLLUP (dept)
D. SELECT name, dept FROM employees GROUP BY CUBE (dept))
Get answer

Question 6
Which two of the following are optional and do not have to be specified when creating a table?
A. Table name
B. Column name
C. Default constraint
D. Column data type
E. NOT NULL constraint
Get answer

Question 7
If the following SQL statement is executed:
CREATE TABLE sales
(invoice_no NOT NULL PRIMARY KEY,
sales_date DATE,
sales_amt NUMERIC(7,2))
IN tbsp0, tbsp1, tbsp2, tbsp3
PARTITION BY RANGE (sales_date NULLS FIRST)
(STARTING '1/1/2007' ENDING '12/31/2007'
EVERY 3 MONTHS)Which of the following statements is true?
A. Administrative tasks such as backing up, restoring, and reorganizing data stored in the SALES table must be done at the table level; not at the partition level
B. Data can be quickly rolled in and out of the SALES table by using the ATTACH PARTITION and DETACH PARTITION clauses of the ALTER TABLE statement
C. If an index is created for the SALES table, its data must be stored in table space TBSP0
D. When resolving queries against the SALES table, each partition used is scanned asynchronously and the results of each partition scan are merged to produce the result data set returned
Get answer

Question 8
A user wishing to invoke an SQL stored procedure that queries a table must have which of the following privileges?
A. CALL privilege on the procedure; SELECT privilege on the table
B. CALL privilege on the procedure; REFERENCES privilege on the table
C. EXECUTE privilege on the procedure; SELECT privilege on the table
D. EXECUTE privilege on the procedure; REFERENCES privilege on the table
Get answer

Question 9
Which of the following is NOT an attribute of Declared Global Temporary Tables (DGTTs)?
A. Each application that defines a DGTT has its own instance of the DGTT
B. Two different applications cannot create DGTTs that have the same name
C. DGTTs can only be used by the application that creates them, and only for the life of the application
D. Data stored in a DGTT can exist across transaction boundaries
Get answer

Question 10
Given the following table definition:
SALES
¯¯¯¯¯¯¯¯¯¯¯
| SALES_DATE | DATE |
| SALES_PERSON | CHAR(20) |
| REGION | CHAR(20) |
| SALES | INTEGER |
Which of the following SQL statements will remove all rows that had a SALES_DATE in the year 1995?
A. DELETE * FROM sales WHERE YEAR(sales_date) = 1995
B. DELETE FROM sales WHERE YEAR(sales_date) = 1995
C. DROP * FROM sales WHERE YEAR(sales_date) = 1995
D. DROP FROM sales WHERE YEAR(sales_date) = 1995
Get answer
