Exam C2090-600 All QuestionsBrowse all questions from this exam
Question 42

If the following SQL statements are executed:

How many rows will be added to the DEPARTMENT table?

    Correct Answer: D

    The SQL statements provided create a table named 'department' with a 'deptno' column specified as NOT NULL and a 'location' column. A primary key constraint for 'deptno' is added but it is not enforced, meaning duplicate entries can be inserted without any issue. Thus, when attempting to insert the four rows, all four will be successfully added to the table despite having duplicates in the 'deptno' column. Therefore, the number of rows that will be added to the DEPARTMENT table is 4.

Discussion
db2testerOption: D

The correct answer is well "D- 4" because the keyword "NOT ENFORCED" is used with the primary key. See reference : https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/c0023324.html You can create a not-enforced primary key or unique constraint for either a column-organized or row-organized table. Unlike an enforced primary key or unique constraint, a not-enforced primary key or unique constraint does not create an index on the data. Specify an informational constraint only if the table data is independently known to conform to the constraint. Because the Db2® database manager does not enforce uniqueness for these constraints, if the table data violates the not-enforced constraint, incorrect results can occur. You cannot reference not-enforced primary key constraints in any enforced referential integrity definitions.