| |
Question 1 | The correct answer is C. Big integer (BIGINT), small integer (SMALLINT), and integer (INTEGER) are all valid DB2 UDB data types. IDENTITY is a keyword used with the CREATE TABLE statement to indicate that the DB2 Database Manager is to automatically generate values for a specific column. |
| |
Question 2 | The correct answer is B. To create a referential constraint, you define a primary key, using one or more columns in the parent table, and you define a foreign key for one or more corresponding columns in the child table that reference the parent table's primary key. |
| |
Question 3 | The correct answer is A. The ON DELETE NO ACTION definition ensures that whenever a delete operation is performed on the parent table in a referential constraint, the value for the foreign key of each row in the child table will have a matching value in the parent key of the parent table (after all other referential constraints have been applied). Therefore, no row will be deleted from TABLEA because a row exists in TABLEB that references the row the DELETE statement is trying to remove. And because the ON DELETE CASCADE definition was not used, no row will be deleted from TABLEB. |
| |
Question 4 | The correct answer is B. The binary large object (BLOB) data type is used to store binary data, the double-byte character large object (DBCLOB) data type is used to store double-byte character data, and the fixed-length double-byte character string (GRAPHIC) data type is used to store double-byte character data strings. The character large object (CLOB) data type, on the other hand, is used to store single-byte character data. |
| |
Question 5 | The correct answers are C and E. When the CREATE TABLE LIKE statement is executed, each column of the table that is created will have exactly the same name , data type and nullability characteristic as the columns of the source table used to create the new table. Furthermore, if the EXCLUDING COLUMN DEFAULTS option is not specified, all column defaults will be copied as well. However, the new table will not contain any unique constraints, foreign key constraints, triggers, or indexes that exist in the original. |
| |
Question 6 | The correct answer is C. The variable-length character string (VARCHAR) data type is used to store single-byte character string data. The remaining data types ”double-byte character large object (DBCLOB), fixed-length double-byte character string (GRAPHIC), and varying-length double-byte character string (VARGRAPHIC) ”are used to store double-byte character data. |
| |
Question 7 | The correct answer is C. The check constraint (CONST1) for TABLEA will only allow the values 1, 2, or 3 to be entered into column COL1. The NOT NULL constraint prohibits null values, the value 0 is not a valid value, and the value '1' is a character value (the column COL1 was defined using a numeric data type). |
| |
Question 8 | The correct answer is D. The ON DELETE RESTRICT delete rule and the ON DELETE NO ACTION delete rule prevent the deletion of parent rows in a parent table if dependent rows that reference the primary row being deleted exist in the corresponding child table, and the ON DELETE SET NO VALUE delete rule is an invalid rule. On the other hand, the ON DELETE CASCADE delete rule will allow rows in the parent table to be deleted; if dependent rows that reference the primary row being deleted exist in the corresponding child table, they will be deleted as well. |
| |
Question 9 | The correct answer is D. The decimal (DECIMAL or NUMERIC) data type is used to hold the number ”the precision is 10 because 10 numbers will be displayed and the scale is 3 because the number contains three decimal places. |
| |
Question 10 | The correct answer is B. Because column COL2 was defined using a varying-length character string (VARCHAR) data type, the default value provided for the default constraint must be enclosed in single quotes. Had the value 'NONE' been provided instead of the value NONE, the column COL2 would have been created. Instead, because column COL2 could not be created, the table TAB1 was not created. |
| |
Question 11 | The correct answer is D. A unique index, a check constraint, and a referential constraint place restrictions on what can and cannot be stored in the column(s) they are associated with. A default constraint, however, is used to provide a default value for a particular column if no data is provided for that column when data is inserted into a table; if a value is provided for the column, the default value is ignored. |
| |
Question 12 | The correct answer is B. Both primary keys and unique indexes can be defined over one or more columns in a table. |
| |
Question 13 | The correct answer is C. The date (DATE) data type can only be used to store date values and time values must be stored in either time (TIME) data types or timestamp (TIMESTAMP) data types. However, a character representation of a date or time value can be stored in any of the character string data types available; the character large object (CLOB) data type and the varying-length character string (VARCHAR) data type are character string data types. |
| |
Question 14 | The correct answer is A. Because the value 'A02' violates the check constraint CONST1 (the value provided for the column COL1 must be either 'A01', 'B02', or 'C03'), the INSERT operation will be rejected and an error code will be returned. |