Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Inserting data records (objects): 1. Inserting values in Stock_objtab INSERT INTO Stock_objtab VALUES(1004, 6750.00, 2) ; Also insert two more records , and . 2.

image text in transcribed

Inserting data records (objects):

1. Inserting values in Stock_objtab INSERT INTO Stock_objtab VALUES(1004, 6750.00, 2) ; Also insert two more records , and .

2. Inserting values in Customer_objtab INSERT INTO Customer_objtab VALUES ( 1, 'Jean Nance', Address_objtyp('2 Avocet Drive', 'Redwood Shores', 'CA', '95054'), PhoneList_vartyp('415-555-1212') ) ; Also insert another record,

3. Inserting the order values of customer number 1 in PurchaseOrder_objtab INSERT INTO PurchaseOrder_objtab SELECT 1001, REF(C),SYSDATE, '10-MAY-1999',LineItemList_ntabtyp(),NULL FROM Customer_objtab C WHERE C.CustNo = 1; And inserting the item values of the purchase order 1001 in the nested table LineItemList_ntab /* Insert a line item into the nested table identified by the TABLE expression. */ INSERT INTO TABLE ( SELECT P.LineItemList_ntab FROM PurchaseOrder_objtab P WHERE P.PONo = 1001 ) SELECT 01, REF(S), 12, 0 FROM Stock_objtab S WHERE S.StockNo = 1534 ;

Querying 1. Query all purchase order numbers. ____________ ____________________;

2. Query customer and line item data for purchase order 1001. SELECT DEREF(p.Cust_ref), p.ShipToAddr_obj, p.PONo, p.OrderDate, LineItemList_ntab FROM ______________ WHERE _____________;

3. Query total value of each purchase order using a member function. SELECT p.PONo, ___________ FROM ___________________ ;

Dato Table PURCHASEORDER_OBJTAB (of PURCHASEORDER_OBJTYP) PONO CUST. REF ORDERDATE SHIPDATE | LINEITEMLIST_NTAB SHIPTOADDR_OBJ Number Reference Date Nostod Tablo Object Type NUMBER CUSTOMER_| DATE DATE LINEITEMLIST ADDRESS OBJTYP NTABTYP OBJTYP PK FK MEMBER FUNCTION getPONO RETURN NUMBER MEMBER FUNCTION SumLineltems RETURN NUMBER Reference to a row of the table Table CUSTOMER_OBJTAB (of CUSTOMER_OBJTYP) CUSTNO CUSTNAME ADDRESS_OBJ PHONELIST_VAR Number Text Object Type Varray NUMBER VARCHAR2(200) ADDRESS OBJTYP PHONELIST_VARTYP PK Column LINEITEMLIST_NTAB (of LINEITEMLIST_NTABTYP (as table of LINEITEM_OBJTYP)) LINEITEMNO STOCK_REF QUANTITY DISCOUNT Number Reference Number Number NUMBER STOCKITEM_OBJTYP NUMBER NUMBER Refers to a row of the table Table STOCK_OBJTAB (of STOCKITEM_OBJTYP) STOCKNO PRICE TAXRATE Number NUMBER PK Number NUMBER Number NUMBER Figure. Object relational representation of PurchaseOrder objtab table

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_2

Step: 3

blur-text-image_3

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions