Click the Exhibit button.
CREATE TABLE gradereport(sid INTEGER, info XML);
INSERT INTO gradereport VALUES (1,
'<studentinfo sid="1">
<name>John Smith</name>
<honours>No</honours>
<grades>
<course><name>ECE100</name><grade>80</grade></course>
<course><name>CSC100</name><grade>70</grade></course>
<course><name>MAT100</name><grade>75</grade></course>
</grades>
<phone type="mobile">416-333-8725</phone>
</studentinfo>');
Given the statements shown in the exhibit, a user wishes to obtain the following result:
<student><name>John Smith</name><phone>416-333-8725</phone></student>
Which query can the user execute to achieve this?
A. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo where $studinfo/@sid="1" return
B. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo where $studinfo/@sid="1" return
C. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo return
D. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo where $studinfo/@sid="1" return {$studinfo/name}{$studinfo/phone/text()}
正解:A
質問 2:
Click the Exhibit button.
CREATE TABLE prod_type (prod_type VARCHAR(10), description VARCHAR (30));
CREATE TABLE prod_descr(info XML);
INSERT INTO prod_descr VALUES
('<product id="1">
<name>Orange juice</name>
<company>Orange Garden</company>
<type>Drinks</type>
</product>'),
('<product id="2">
<name>Coke</name>
<company>Best drinks</company>
<type>Drinks</type>
<type>Premium</type>
</product>');
INSERT INTO prod_type VALUES ('Drinks','Drinks');
You execute the SQL statement shown in the exhibit.
Which two statements will return rows? (Choose two.)
A. SELECT name, company, description FROM
prod_type, prod_descr, XMLTABLE(
'$INFO/product[type=$PROD_TYPE]'
COLUMNS
name VARCHAR(20) PATH './name',
company VARCHAR(20) PATH './company'
);
B. SELECT name, company, description FROM
prod_type, prod_descr, XMLTABLE(
'$INFO/product'
COLUMNS
name VARCHAR(20) PATH './name',
company VARCHAR(20) PATH './company'
)
WHERE
prod_type= XMLCAST (XMLQUERY('$INFO/product/type') AS VARCHAR(10));
C. SELECT name, company, description FROM
prod_type, prod_descr, XMLTABLE(
'$INFO/product'
COLUMNS
name VARCHAR(20) PATH './name',
company VARCHAR(20) PATH './company'
)
WHERE
XMLEXISTS('$INFO/product[type = $PROD_TYPE]');
D. SELECT name, company, description FROM
prod_type, prod_descr, XMLTABLE(
'$INFO/product'
COLUMNS
type VARCHAR(10) PATH './type',
name VARCHAR(20) PATH './name',
company VARCHAR(20) PATH './company'
)
WHERE
type=prod_type;
正解:A,C
質問 3:
A company has a requirement that will update data on multiple databases. The data currently
resides on databases that are part of the DB2 family of products.
What would be two minimum configurations needed to facilitate the correct update on all database
servers without loss of data integrity? (Choose two.)
A. Configure DB2 as a Transaction Manager on the database server.
B. Configure DB2 as a Transaction Manager on the client application server.
C. Configure an XA-compliant Transaction Manager on the client application server.
D. Configure the Sync Point Manager on the database server.
正解:B,D
質問 4:
Click the Exhibit button.
CONNECT TO test;
CREATE TABLE colors(id INT NOT NULL PRIMARY KEY,
descVARCHAR(12));
CREATE TABLE objects(desc VARCHAR(12),
c_idINT REFERENCES colors (id)
ON UPDATE NO ACTION);
INSERT INTO colors VALUES (1, 'Red'), (2, 'Blue'), (3, 'Yellow'), (4, 'Green');
INSERT INTO objects VALUES ('Fire Engine', 1), ('Grass', 4), ('Banana', 3);
CONNECT RESET;
A DB2 Command Line Processor script file containing the commands and statements shown in
the exhibit was executed successfully.
The statement shown below is executed:
UPDATE colors SET id = id + 1;
How many records will be modified?
A. 0
B. 1
C. 3
D. 2
正解:A
質問 5:
Which two SQL statements demonstrate the correct usage of a parameter marker? (Choose two.)
A. VALUES(?) INTO :hvar1
B. SET CURRENT SQLID = ?
C. SELECT ? FROM employee
D. DELETE FROM employee WHEREempno = ?
正解:B,D
質問 6:
.In a PHP script, which ibm_db2 functions should be used if the user wants to retrieve a row in a result set as an array, indexed by column name?
A. db2_fetch_array()
B. db2_fetch_object()
C. db2_fetch_assoc()
D. db2_fetch_both()
正解:C
河*瞳 -
ボリューム的に足りないかな?と心配しましたが、そんなことはありませんでした。Pass4Testいいね。念を入れたい人は本書を導入とした上で過去問中心の参考書も併用することをPass4Testおすすめします。