August 13, 2007
Here are two more questions from my book DB2 9 Fundamentals Certification Study Guide, published by MC Press and reprinted here with permission.
Question 5
Which type of key is defined on the child table to implement a referential constraint?
A. Unique key
B. Primary key
C. Foreign key
D. Composite key
Question 6
A table contains a list of all seats available at a football stadium. A seat consists of a section number, a seat number, and whether or not the seat has been assigned. A ticket agent working at the box office generates a list of all unassigned seats. When the agent refreshes the list, it should only change if another agent assigns one or more unassigned seats. Which of the following is the best isolation level to use for this application?
A. Repeatable Read
B. Read Stability
C. Cursor Stability
D. Uncommitted Read
Answer 5
The correct answer is C. 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. (The list of column names in the foreign key clause must be identical to the list of column names specified in the primary key OR a unique constraint for the columns in the parent table that are referenced by the foreign key in the child must exist in order for a referential constraint to be successfully created.)
Answer 6
The correct answer is C. If the Repeatable Read isolation level is used, other agents will be unable to assign seats as long as the transaction that generated the list remains active; therefore, the list will not change when it is refreshed. If the Read Stability isolation level is used, other agents will be able to unassign currently assigned seats (and these unassigned seats will show up when the list is refreshed), but they will not be able to assign any seat that ap-pears in the list as long as the transaction that generated the list remains active. If the Uncommitted Read isolation level is used, other agents will be able to unassign currently assigned seats, as well as assign unassigned seats; however, uncommitted seat unassign-ments/assignments will show up when the list is refreshed, and the agent may make an inappropriate change based on this data. Therefore, the best isolation level to use for this particular application is the Cursor Stability isolation level.
Trackback Pings
TrackBack URL for this entry:
http://www.ibmdatabasemag.com/blog/main/archives/2007/08/question_5_whic.html
« DB2 LUW Performance: Detecting Index Leaf Page Scans | Main | DB2 LUW Performance: Progress Review plus Closing Files »
This is a public forum. CMP Media and its affiliates are not responsible for and do not control what is posted herein. CMP Media makes no warranties or guarantees concerning any advice dispensed by its staff members or readers.
Community standards in this comment area do not permit hate language, excessive profanity, or other patently offensive language. Please be aware that all information posted to this comment area becomes the property of CMP Media LLC and may be edited and republished in print or electronic format as outlined in CMP Media's Terms of Service.
Important Note: This comment area is NOT intended for commercial messages or solicitations of business.
