You are on page 1of 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>

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

Metal</name> <quantity>1</quantity> </item> <PurchaseOrder> B. Large</name> <quantity>2</quantity> </item> <item> <partid>100-100-01</partid> <name>Sled. pureXML supported for UNICODE or non-UNICODE databases D. <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled. <PurchaseOrder> <item> <partid>100-201-01</partid> <name>Heater. A. Relational data is semi-structured and XML data is structured D. Metal</name> <quantity>1</quantity> </item> <PurchaseOrder> 7.6. Compatible XML Schema evolution using the UPDATE XMLSCHEMA command C. <PurchaseOrder> <PurchaseOrder> C. 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. Assuming that the PORDER column contains the following XML data: <PurchaseOrder> <item> <partid>100-100-01</partid> <name>Sled. Can transform XML documents using XSLT functions B. pureXML compression 8. Relational data is nested and XML data is flat B. Large</name> <quantity>2</quantity> </item> <PurchaseOrder> D. Relational model uses NULL for unknown state and in XML model NULLs don't exist . Which of the following is true about relational and hierarchical (XML) models? A. Metal</name> <quantity>1</quantity> </item> <item> <partid>100-201-01</partid> <name>Heater. Relational model retrieves sequences and XML is set oriented C. Which of the following is not supported by pureXML? A. <PurchaseOrder> <item> <partid>100-201-01</partid> <name>Heater.

attribute D. /dept/@bldg B. <PurchaseOrder xmlns="http://posample. Which of the following is NOT an XML characteristic? A. row 13. XMLELEMENT (NAME "poid". /dept/employee/name C. It provides functions to work with both XML and relation data at the same time B. STATUS). /dept . XML is not easy to extend C. XMLELEMENT (NAME "custid".org" status="Pending"> <poid>5001</poid> <custid>2222</custid> </PurchaseOrder> C. <PurchaseOrder xmlns="http://posample. It is an extension of the SQL language C. CUSTID)) from PURCHASEORDER where POID = 5001 A. XML describes itself D. /dept/employee/text() D. XMLNAMESPACES (DEFAULT 'http://posample.9.org"> <status>pending</status> <poid>5001</poid> <custid>2222</custid> </PurchaseOrder> B.org'). element C. It provides support for using XML in the context of a relational database system 10. Which of the following is NOT a type of node that an XML can have? A. POID). XML is flexible B. Which of the following is NOT true about SQL/XML? A. 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". It is the same as XQuery D. <PurchaseOrder status="Pending"> <poid>5001</poid> <custid>2222</custid> </PurchaseOrder> 12. XML is independent of the platform or vendor 11. document B. Which one of the following is a valid XPATH expression to retrieve an attribute value within an XML document? A. <PurchaseOrder xmlns="http://posample.org" status="Pending"> <poid>5000</poid> <custid>1111</custid> </PurchaseOrder> D. XMLATTRIBUTE (NAME "status".

<phone type=123>123-4567</phone> D. XMLSEQUENCE . XMLEXISTS D. RETURN is used to construct query results 16. XMLQUERY B. <course units="3"> <name>ADVANDB</name> <sec>s11</sec> <sec>s22</sec> </course> 15. XMLTABLE C. <employee> <name>John </employee></name> B. <department></department> <name>John</name> C. Which of the following XML function tests if an XQuery expression returns a sequence? A. LET is used to eliminate items of the iteration C. Which of the following is true about the FLWOR expression? A.14. Which of the following is a well-formed XML document? A. WHERE is used to reorder items of the iteration D. FOR is used to bind a variable to a sequence B.