Click the Exhibit button.
<personinfo>
<name>John Smith</name>
<address type="private">
<city>New York</city>
<country>US</country>
<phone>850-734-6672</phone>
</address>
<phone type="mobile">796-858-1272 </phone>
<phone type="security">646-252-1053</phone>
</personinfo>
The table PERSON is declared as shown below:
CREATE TABLE person (id BIGINT, info XML)
The document shown in the exhibit is successfully inserted into the table.
How many rows will be returned for the following statement?
SELECT t.* FROM
xmlapp.PERSON,
XMLTABLE (
'$INFO/personinfo'
COLUMNS
name VARCHAR(30) PATH './name',
phone VARCHAR(30) PATH './phone'
) AS t
A. 0
B. 4
C. 6
D. 2
正解:A
質問 2:
Which type of join condition specifies that the result table will contain a row for each row from the Table to the left, concatenated with each row from the table to the right?
A. EXCEPTION JOIN
B. CROSS JOIN
C. FULL OUTER JOIN
D. INNER JOIN
正解:B
質問 3:
A CLI/ODBC application contains the lines of code shown below:
SQLHANDLE hstmt; /* statement handle */
SQLCHAR *stmt = (SQLCHAR *)"DELETE FROM org WHERE deptnumb = ? ";
SQLSMALLINT parameter1=5;
SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
SQLSetStmtAttr(hstmt, SQL_ATTR_DEFERRED_PREPARE, SQL_DEFERRED_PREPARE_OFF
);
If table ORG does not exist, which two CLI/ODBC APIs will return SQL_ERROR in the variable RC? (Choose two.)
A. rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SHORT, SQL_SMALLINT, 0,
0,
¶meter1, 0, NULL);
B. rc = SQLSetConnectAttr( hdbc, SQL_ATTR_AUTOCOMMIT,
(SQLPOINTER)SQL_AUTOCOMM?IT_OFF, SQL_NTS);
C. rc = SQLPrepare(hstmt, stmt, SQL_NTS);
D. rc = SQLExecute(hstmt);
正解:C,D
質問 4:
Click the Exhibit button.
CONNECT TO test;
CREATE TABLE colors(id INT NOT NULL PRIMARY KEY,
descVARCHAR(12));
CREATE TABLE fruits(desc VARCHAR(12),
c_idINT REFERENCES colors (id)
ON UPDATE RESTRICT);
INSERT INTO colors VALUES (1, 'Red'), (2, 'Yellow'), (3, 'Blue');
INSERT INTO fruits VALUES ('Apple', 1), ('Banana', 2);
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 rows will be modified in the COLORS table?
A. 0
B. 1
C. 3
D. 2
正解:A
質問 5:
Which statement should be used to obtain the result set shown below?
<Root>
<First>Hello</First>
<Second>World !</Second>
<?Test Pass test?>
</Root>
A. VALUES XMLDOCUMENT(
XMLELEMENT (NAME "Root",
XMLELEMENT(NAME "First", 'Hello'),
XMLELEMENT(NAME "Second", 'World !'),
XMLTEXT ('Test Pass test')
)
)
B. VALUES XMLDOCUMENT(
XMLELEMENT (NAME "Root",
XMLELEMENT(NAME "First", 'Hello'),
XMLELEMENT(NAME "Second", 'World !'),
XMLATTRIBUTES ( 'Pass test' as "test")
)
)
C. VALUES XMLDOCUMENT(
XMLELEMENT (NAME "Root",
XMLFOREST(
'Hello' as "First",
'World !' as "Second"
),
XMLPI (NAME "Test", 'Pass test')
)
)
D. VALUES XMLDOCUMENT(
XMLELEMENT (NAME "Root",
XMLFOREST(
'Hello' as "First",
'World !' as "Second"
),
XMLCOMMENT ('Test Pass test')
)
)
正解:C