PrepAway - Latest Free Exam Questions & Answers

What is the result of the following XQuery expression?

Given the following CREATE TABLE statement:
CREATE TABLE customer(custid INTEGER, info XML)
And the following INSERT statements:
INSERT INTO customer VALUES (1000,
‘<customerinfo xmlns=”http://custrecord.dat” custid=”1000″>
<name>John Doe</name>
<addr country=”United States”>
<street>25 East Creek Drive</street>
<city>Raleigh</city>
<state-prov>North Carolina</state-prov>
<zip-pcode>27603</zip-pcode>
</addr>
<phone type=”work”>919-555-1212</phone>
<email>john.doe@abc.com</email>
</customerinfo>’);
INSERT INTO customer VALUES (1000,
‘<customerinfo xmlns=”http://custrecord.dat” custid=”1001″>
<name>Paul Smith</name>
<addr country=”Canada”>
<street>412 Stewart Drive</street>
<city>Toronto</city>
<state-prov>Ontario</state-prov>
<zip-pcode>M8X-3T6</zip-pcode>
</addr>
<phone type=”work”>919-555-4444</phone>
<email>psmith@xyz.com</email>
</customerinfo>’);
What is the result of the following XQuery expression?
XQUERY declare default element namespace “http://custrecord.dat”; for
$info in db2-fn:xmlcolumn(‘CUSTOMER.INFO’)/customerinfo where
$info/addr/state-prov=”Ontario” return $info/name/text();

PrepAway - Latest Free Exam Questions & Answers

A.
Paul Smith
NUMBER

B.
<namexmlns=”http://custrecord.dat”>Paul Smith</name>
INTERVAL

C.
<customerinfo xmlns=”http://custrecord.dat” custid=”1001″><name
xmlns=”http://custrecord.dat”>Paul Smith</name>
BYTE

D.
<customerinfo xmlns=”http://custrecord.dat” custid=”1001″>Paul Smith</customerinfo>
QUESTION 176
Which of the following is a valid DB2 data type?
NUM

A.
Paul Smith
NUMBER

B.
<namexmlns=”http://custrecord.dat”>Paul Smith</name>
INTERVAL

C.
<customerinfo xmlns=”http://custrecord.dat” custid=”1001″><name
xmlns=”http://custrecord.dat”>Paul Smith</name>
BYTE

D.
<customerinfo xmlns=”http://custrecord.dat” custid=”1001″>Paul Smith</customerinfo>
QUESTION 176
Which of the following is a valid DB2 data type?
NUM

One Comment on “What is the result of the following XQuery expression?


Leave a Reply