Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Click the Exhibit ( s ) button to examine the data from the PO _ HEADER and PO _ DETAIL tables. Examine the structures of

Click the Exhibit(s) button to examine the data from the PO_HEADER and PO_DETAIL tables. Examine the structures of the PO_HEADER and PO_DETAIL tables:
PO_HEADER
--------------------
PO_NUM NUMBER NOT NULL
PO_DATE DATE DEFAULT SYSDATE
PO_TOTAL NUMBER(9,2)
SUPPLIER_ID NUMBER(9)
PO_TERMS VARCHAR2(25)
PO_DETAIL
------------------
PO_NUM NUMBER NOT NULL
PO_LINE_ID NUMBER NOT NULL
PRODUCT_ID NUMBER NOT NULL,
QUANTITY NUMBER(3) NOT NULL,
UNIT_PRICE NUMBER (5,2) DEFAULT 0
The primary key of the PO_HEADER table is PO_NUM. The primary key of the PO_DETAIL table is the combination of PO_NUM and PO_LINE_ID. A FOREIGN KEY constraint is defined on the PO_NUM column of the PO_DETAIL table that references the PO_HEADER table. You want to update the purchase order total amount for a given purchase order. The PO_TOTAL column in the PO_HEADER table should equal the sum of the extended amounts of the corresponding PO_DETAIL records. You want the user to be prompted for the purchase order number when the query is executed. When a purchase order is updated, the PO_DATE column should
A.
UPDATE po_header
SET po_total =(SELECT SUM(ext)
FROM (SELECT po_num, quantity * unit_price ext
FROM po_detail
WHERE po_num = &&ponum)),
SET po_date = sysdate
WHERE po_num = &&ponum;
B.
UPDATE po_header
SET po_total =(SELECT SUM(quantity * unit_price)
FROM (SELECT po_num)
FROM po_detail
WHERE po_num = &&ponum)),
po_date = DEFAULT
WHERE po_num = &&ponum;
C.
UPDATE po_header
SET po_total =(SELECT SUM(ext)
FROM (SELECT po_num, quantity * unit_price ext
FROM po_detail
WHERE po_num = &&ponum)),
UPDATE po_header
SET po_date = sysdateWHERE po_num = &&ponum;
D.
UPDATE po_header
SET po_total =(SELECT SUM(ext)
FROM (SELECT po_num, quantity * unit_price ext
FROM po_detail
WHERE po_num = &&ponum)),
po_date = DEFAULT
WHERE po_num = &&ponum;
E.
UPDATE po_header
SET po_total =(SELECT po_num, SUM(ext)
FROM (SELECT po_num, quantity * unit_price ext
FROM po_detail
WHERE po_num = &&ponum)),
po_date = DEFAULT
WHERE po_num = &&ponum;
F.
UPDATE po_header
SET po_total =(SELECT SUM(ext)
FROM (SELECT po_num, quantity * unit_price ext
FROM po_detail
WHERE po_num = &&ponum)),
po_date = NULL
WHERE po_num = &&ponum;PO_HEADER
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions