IBM DB2 11.1 Advanced DBA for Linux, UNIX, and Windows — Question 40
Which of the following statements will successfully create a table that scores index data in a different table space than the table data?
Answer options
- A. CREATE TABLE t1 (c1 INT, c2 INT);
- B. CREATE TABLE t1 (c1 INT, c2 INT) IN TS1 INDEX IN TS2;
- C. CREATE TABLE t1 (c1 INT, c2 INT) IN TS1 INDEX IN TS1;
- D. CREATE TABLE t1 (c1 INT, c2 INT) DATA IN TS1 INDEX IN TS2;
Correct answer: B
Explanation
Option B is correct because it explicitly specifies that the table data will be created in TS1 while the index will be created in TS2, achieving the requirement of separate tablespaces. Option A does not specify any tablespace, so it defaults to the system tablespace. Options C and D incorrectly either place both the table and index in the same tablespace or do not separate them properly, hence they are not valid for the requirement.