Name: 
 

Transaction management



Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

1. 

You want to examine the current balance for account number 45689 located in the checkacc table.  That transaction can be completed by using the SQL code:
a.
SELECT ACC_NUM, ACC_BALANCE
      FROM CHECKACC
         WHERE ACC_NUM = "45689";
b.
SELECT ACC_NUM, ACC_BALANCE
      FROM CHECKACC
         WHERE ACCNUM = '45689';
c.
SELECT ACC_NUM, ACC_BALANCE
      FROM CHECKACC
         WHERE ACC_NUM = '45689';
d.
SELECT ACC_NUM, ACC_BALANCE
      FROM CHECKACC
         WHERE ACC_NUM <> '45689';
 

2. 

Suppose that an account wishes to register the credit of 50 units of product X to customer Y in the amount of $350.  The required transactions can be completed by:
           1) reducing product X's quantity on hand (QQH) by 50
           2) adding $350 to customer Y's accounts receivable.
Using SQL you would write:
a.
UPDATE PRODUCT
      SET PROD-QQH = PROD_QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT_BALANCE = ACCT_BALANCE + 350
             WHERE ACCT_NUM = 'Y';
b.
UPDATE PRODUCT
      SET PROD_QQH = PROD_QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT-BALANCE = ACCT_BALANCE + 350
             WHERE ACCT_NUM = 'Y';
c.
UPDATE PRODUCT
      SET PROD-QQH = PROD-QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT-BALANCE = ACCT-BALANCE + 350
             WHERE ACCT_NUM = 'Y'
d.
UPDATE PRODUCT
      SET PROD_QQH = PROD_QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT_BALANCE = ACCT_BALANCE + 350
             WHERE ACCT_NUM = 'Y';
 

3. 

For the following sale of 10 units of product X, the inventory UPDATE commands were written
a.
UPDATE PRODUCT
     SET PROD_QQH = PROD_QQH + 10
          WHERE PROD_CODE = 'X';
b.
UPDATE PRODUCT
     SET PROD_QQH = PROD_QQH + 10
          WHERE PROD_CODE = 'X';
c.
UPDATE PRODUCT
     SET PROD-QQH = PROD-QQH - 10
          WHERE PROD_CODE = 'X';
d.
UPDATE PRODUCT
     SET PROD_QQH = PROD_QQH - 10
          WHERE PROD_CODE = 'X'
 

4. 

All transactions properties must display
a.
atomicity, serializability, and durability.
b.
durability and isolation.
c.
serializability, durability, and isolation.
d.
atomicity, durability, serializability, and isolation.
 

5. 

Suppose that an account wishes to register the credit of 50 units of product X to customer Y in the amount of $350.  The required transactions can be completed by:
           1) reducing product X's quantity on hand (QQH) by 50
           2) adding $350 to customer Y's accounts receivable.
Using SQL you would write:
a.
UPDATE PRODUCT
      SET PROD-QQH = PROD_QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT_BALANCE = ACCT_BALANCE + 350
             WHERE ACCT_NUM = 'Y';
COMMIT;
b.
UPDATE PRODUCT
      SET PROD_QQH = PROD_QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT-BALANCE = ACCT_BALANCE + 350
             WHERE ACCT_NUM = 'Y';     
COMMIT;
c.
UPDATE PRODUCT
      SET PROD-QQH = PROD-QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT-BALANCE = ACCT-BALANCE + 350
             WHERE ACCT_NUM = 'Y'     
COMMIT;
d.
UPDATE PRODUCT
      SET PROD_QQH = PROD_QQH - 50
            WHERE PROD_CODE = 'X';
UPDATE ACCT_RECEIVABLE
      SET ACCT_BALANCE = ACCT_BALANCE + 350
             WHERE ACCT_NUM = 'Y';
COMMIT;
 

6. 

A lock that prevents the use of any tables in the database from one transaction while another transaction is being processed is called a
a.
database-level lock.
b.
table-level lock.
c.
page-level lock.
d.
row-level lock.
e.
field-level lock.
 

7. 

A lock that locks the entire table preventing access to any row by a transaction while another transaction is using the table is referred to as a
a.
database-level lock.
b.
table-level lock.
c.
page-level lock.
d.
row-level lock.
e.
field-level lock.
 

8. 

A lock that locks the entire diskpage is referred to as a
a.
transaction-level lock.
b.
table-level lock.
c.
page-level lock.
d.
row-level lock.
e.
field-level lock.
 

9. 

A lock that allows concurrent transactions to access different rows of the same table is known as a
a.
database-level lock.
b.
table-level lock.
c.
page-level lock.
d.
row-level lock.
e.
field-level lock.
 

10. 

A diskpage has a fixed size that can only be
a.
4K.
b.
8K.
c.
16K.
d.
32K.
e.
none of the above.
 

11. 

A lock that has only two stages (0 & 1) is known as a(n)
a.
shared lock.
b.
exclusive lock.
c.
binary lock.
d.
two-phase locking.
e.
deadlocks.
 

12. 

A lock that specifically reserves access for the transaction that locked the object is known as a(n)
a.
shared lock.
b.
exclusive lo.ck
c.
binary lock.
d.
two-phase lock.
e.
deadlocks.
 

13. 

A lock that exists when concurrent transactions are granted read access on the basis of a common lock is known as a(n)
a.
shared lock
b.
exclusive lock
c.
binary lock
d.
two-phase lock
e.
deadlock
 

14. 

A lock that defines how transactions acquire and relinquish locks is known as a(n)
a.
shared lock.
b.
exclusive lock.
c.
binary lock.
d.
two-phase lock.
e.
deadlocks.
 

15. 

A condition that occurs when two transactions wait for each other to unlock data is known as a(n)
a.
shared lock.
b.
exclusive lock.
c.
binary lock.
d.
two-phase lock.
e.
deadlocks.
 

16. 

The two-phase locking protocol is governed by the following rules
a.
two transactions can have conflicting locks.
b.
no unlock operation can precede a lock operation in a different transaction.
c.
no data are affected until all locks are released.
d.
all of the above
e.
none of the above
 

17. 

The techniques to control deadlocks are
a.
deadlock prevention.
b.
deadlock detection.
c.
deadlock avoidance.
d.
all of the above.
e.
none of the above.
 

18. 

The levels of backup are
a.
full.
b.
differential.
c.
transaction log.
d.
all of the above.
e.
none of the above.
 



 
Check Your Work     Reset Help