Question: 1 . Consider the following SQL code that updates 3 tables and answer A & B: BEGIN TRANSACTION Start transaction INSERT INTO INVOICE Add record

1. Consider the following SQL code that updates 3 tables and answer A & B:
BEGIN TRANSACTION Start transaction
INSERT INTO INVOICE Add record to invoice
(INV_NUM, INV_DATE, ACCNUM, TOTAL)
VALUES (1020,'15-MAR-2018','60120010',3500);
UPDATE INVENTRY Update the quantity on hand of the
SET ON_HAND = ON_HAND 100 product
WHERE PROD_CODE ='345TYX';
UPDATE ACCREC Update the customer balance
SET BALANCE = BALANCE +3500 account
WHERE ACCNUM ='60120010';
COMMIT;
A. How would you change the code to achieve Pessimistic but Not 2-Phase Locking?
B. How would you change the code to achieve Pessimistic 2-Phase Locking protocol?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!