Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For each of the following SQL statement, refer to the above DDBMS scenario and s

ID: 3810406 • Letter: F

Question

For each of the following SQL statement, refer to the above DDBMS scenario and specify the type of operation it is (remote request, remote transaction, distributed transaction, or distributed request).

At Location A:

a. BEGIN WORK;

INSERT PRODUCT(PROD_CODE, PROD_NAME, PROD_QOH)

VALUES ('1265','Drill Bit', 30);

COMMIT WORK;

b. SELECT INV_TOTAL

FROM INVOICE

WHERE INV_TOTAL > 500;

c. SELECT * FROM PRODUCT

WHERE PROD_QOH > 20;

At Location B:

d. BEGIN WORK;

INSERT CUSTOMER(CUS_NUM, CUS_NAME, CUS_ADDRESS, CUS_BAL)

VALUES ('12345','Miss Prince', '3155 Heaven ave', 5.99);

COMMIT WORK;

e. SELECT CUS_NAME, INV_TOTAL

FROM CUSTOMER, INVOICE

WHERE INV_TOTAL < 2000 AND CUSTOMER.CUS_NUM = INVOICE.CUS_NUM;

f. BEGIN WORK;

UPDATE PRODUCT

SET PROD_QOH = PROD_QOH - 10

WHERE PROD_CODE ='1300';

COMMIT WORK;

At site C:

g. BEGIN WORK;

INSERT INTO INVOICE(INV_NUM, CUS_NUM, INV_DATE, INV_TOTAL)

VALUES ('986434', '24352', ‘22-AUG-2013’, 2.00);

COMMIT WORK;

h. SELECT * FROM INVOICE WHERE INV_TOTAL < 2000;

i. SELECT * FROM PRODUCT WHERE PROD_QOH < 25;

j. BEGIN WORK;

UPDATE CUSTOMER

SET CUS_BALANCE = CUS_BALANCE + 200

WHERE CUS_NUM='12934';

INSERT INTO INVOICE(INV_NUM, CUS_NUM, INV_DATE, INV_TOTAL)

VALUES ('867541', '14678', ‘15-DEC-2013’, 200);

UPDATE PRODUCT

SET PROD_QOH = PROD_QOH – 3

WHERE PROD_CODE = '1265';

COMMIT WORK;

k. BEGIN WORK;

INSERT CUSTOMER(CUS_NUM, CUS_NAME, CUS_ADDRESS, CUS_BAL)

VALUES ('24352','John Brow', '1500 Main St', 0.00);

COMMIT WORK;

TABLES FRAGMENTS NIA CUSTOMER PROD A PRODUCT PROD B NA INVOICE NA INV LINE UME PROD A LOCATION Of Ste C

Explanation / Answer

Location A:

Insert operation on product table as product table is in A ocaton still it has fragements.this is a distributed request

2,select operation on inoice which is in locatioin B.Remote request

3,This sequence represents a distributed request,since product table is in 2 fragments A and B

d.CUSTOMER table is in location A.and the work is at location B.
It is remote request
e.the two tables are in two different locations,
it is distributed transaction.
f.distributed request
UPDATE PRODUCT statement accesses two remote sites because the PRODUCT table is divided into two fragments located at two remote sites.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote