Вы находитесь на странице: 1из 5

DB2 Academic Associate DB2 pureXML

1. Assuming that the PORDER column contains the following XML data: <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled, Metal</name> <quantity>1</quantity> </item> <item> <partid>100-201-01</partid> <name>Heater, Large</name> <quantity>2</quantity> </item> <PurchaseOrder> What will be the new value of the PORDER column after executing the following statement? UPDATE purchaseorder SET porder = xmlquery('transform copy $po := $order modify do insert document { <item> <partid>100-103-01</partid> <name>Snow Shovel, Super Deluxe 26 inch</name> <quantity>4</quantity> </item> } into $po/PurchaseOrder return $po' passing PURCHASEORDER.PORDER as "order") WHERE poid=5012; A. <PurchaseOrder> <item> <partid>100-103-01</partid> <name>Snow Shovel, Super Deluxe 26 inch</name> <quantity>4</quantity> </item> <PurchaseOrder> B. <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled, Metal</name> <quantity>1</quantity> </item> <item> <partid>100-201-01</partid> <name>Heater, Large</name> <quantity>2</quantity> </item> <item> <partid>100-103-01</partid> <name>Snow Shovel, Super Deluxe 26 inch</name> <quantity>4</quantity> </item> <PurchaseOrder> C. <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled, Metal</name> <quantity>1</quantity> </item> <item> <partid>100-201-01</partid> <name>Heater, Large</name> <quantity>2</quantity> </item> <PurchaseOrder> D. <PurchaseOrder><PurchaseOrder>

2. Which of the following is the correct syntax for using the XMLTRANSFORM SQL/XML function? A. UPDATE XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ; B. SELECT FROM XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ; C. SELECT INTO XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ; D. SELECT XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 3. Which of the following is NOT true about well-formed XML documents? A. It must have one and only one root element B. Each element begins with a start tag and ends with an end tag C. An element cannot contain other elements D. Attribute values must be enclosed in double quotes 4. Which of the following is true about XML columns? A. XML columns are used to store XML documents as a hierarchical set of entities B. Only XQuery can be used to retrieve an XML document from an XML column C. XML columns must be altered to accommodate additional parent/child relationships if they are used in referential constraints D. In order to access any portion of an XML document stored in an XML column, the entire document must be retrieved 5. Which of the following is NOT true about XML Indexes? A. The two types of System Indexes are XML Region Index and XML Path Index B. The XML region index captures how an XML document is divided up internally into regions C. The XML path index records all unique paths which exist within XML documents stored within an XML column D. User-defined indexes are the ones created by users to improve storage space

6. Assuming that the PORDER column contains the following XML data: <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled, Metal</name> <quantity>1</quantity> </item> <item> <partid>100-201-01</partid> <name>Heater, Large</name> <quantity>2</quantity> </item> <PurchaseOrder> What will be the new value of the PORDER column after executing the following statement? UPDATE purchaseorder SET porder = xmlquery('transform copy $po := $order modify do delete $po/PurchaseOrder/item[partid = ''100-201-01''] return $po' passing porder as "order") WHERE poid=5012; A. <PurchaseOrder> <item> <partid>100-201-01</partid> <name>Heater, Large</name> <quantity>2</quantity> </item> <item> <partid>100-100-01</partid> <name>Sled, Metal</name> <quantity>1</quantity> </item> <PurchaseOrder> B. <PurchaseOrder> <PurchaseOrder> C. <PurchaseOrder> <item> <partid>100-201-01</partid> <name>Heater, Large</name> <quantity>2</quantity> </item> <PurchaseOrder> D. <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled, Metal</name> <quantity>1</quantity> </item> <PurchaseOrder>

7. Which of the following is not supported by pureXML? A. Can transform XML documents using XSLT functions B. Compatible XML Schema evolution using the UPDATE XMLSCHEMA command C. pureXML supported for UNICODE or non-UNICODE databases D. pureXML compression 8. Which of the following is true about relational and hierarchical (XML) models? A. Relational data is nested and XML data is flat B. Relational model retrieves sequences and XML is set oriented C. Relational data is semi-structured and XML data is structured D. Relational model uses NULL for unknown state and in XML model NULLs don't exist

9. Which of the following is NOT true about SQL/XML? A. It provides functions to work with both XML and relation data at the same time B. It is an extension of the SQL language C. It is the same as XQuery D. It provides support for using XML in the context of a relational database system 10. Which of the following is NOT an XML characteristic? A. XML is flexible B. XML is not easy to extend C. XML describes itself D. XML is independent of the platform or vendor 11. Given the following table PURCHASEORDER -------------------------------------POID STATUS CUSTID 5000 Ok 1111 5001 Pending 2222 5002 Pending 3333 What will be the result of the following query select XMLELEMENT (NAME "PurchaseOrder", XMLNAMESPACES (DEFAULT 'http://posample.org'), XMLATTRIBUTE (NAME "status", STATUS), XMLELEMENT (NAME "poid", POID), XMLELEMENT (NAME "custid", CUSTID)) from PURCHASEORDER where POID = 5001 A. <PurchaseOrder xmlns="http://posample.org"> <status>pending</status> <poid>5001</poid> <custid>2222</custid> </PurchaseOrder> B. <PurchaseOrder xmlns="http://posample.org" status="Pending"> <poid>5001</poid> <custid>2222</custid> </PurchaseOrder> C. <PurchaseOrder xmlns="http://posample.org" status="Pending"> <poid>5000</poid> <custid>1111</custid> </PurchaseOrder> D. <PurchaseOrder status="Pending"> <poid>5001</poid> <custid>2222</custid> </PurchaseOrder>

12. Which of the following is NOT a type of node that an XML can have? A. document B. element C. attribute D. row 13. Which one of the following is a valid XPATH expression to retrieve an attribute value within an XML document? A. /dept/@bldg B. /dept/employee/name C. /dept/employee/text() D. /dept

14. Which of the following is a well-formed XML document? A. <employee> <name>John </employee></name> B. <department></department> <name>John</name> C. <phone type=123>123-4567</phone> D. <course units="3"> <name>ADVANDB</name> <sec>s11</sec> <sec>s22</sec> </course>

15. Which of the following is true about the FLWOR expression? A. FOR is used to bind a variable to a sequence B. LET is used to eliminate items of the iteration C. WHERE is used to reorder items of the iteration D. RETURN is used to construct query results 16. Which of the following XML function tests if an XQuery expression returns a sequence? A. XMLQUERY B. XMLTABLE C. XMLEXISTS D. XMLSEQUENCE

Вам также может понравиться