IBM DB2 9.7 Application Development - 000-543 Exam Practice Test
An application connecting to a DB2 database using the IBM Data Server Provider for .NET is
seeing
performance degradation after 100 active users.
Which Visual Basic .NET command string enables the re-use of the database connections?
seeing
performance degradation after 100 active users.
Which Visual Basic .NET command string enables the re-use of the database connections?
Correct Answer: B
Vote an answer
.Click the Exhibit button.
<personinfo>
<name>John Wayne</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>
<personinfo>
<name>Barbara Wayne</name>
<address type="private">
<city>New York</city>
<country>US</country>
<phone>850-734-6672</phone>
</address>
<phone type="mobile">796-858-1231 </phone>
<phone type="security">646-252-1153</phone>
</personinfo>
The table PERSON is declared as shown below:
CREATE TABLE person (id BIGINT, info XML)
The documents shown in the exhibit are successfully inserted into the table.
How many phone numbers will be affected by the statement shown below?
UPDATE xmlapp.person
SET info = xmlquery( 'copy $new := $INFO
modify for $j in $new/personinfo//phone return
do replace value of $j with "444-444-4444"
return $new' )
WHERE XMLEXISTS('$INFO/personinfo[name="John Wayne"]')
<personinfo>
<name>John Wayne</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>
<personinfo>
<name>Barbara Wayne</name>
<address type="private">
<city>New York</city>
<country>US</country>
<phone>850-734-6672</phone>
</address>
<phone type="mobile">796-858-1231 </phone>
<phone type="security">646-252-1153</phone>
</personinfo>
The table PERSON is declared as shown below:
CREATE TABLE person (id BIGINT, info XML)
The documents shown in the exhibit are successfully inserted into the table.
How many phone numbers will be affected by the statement shown below?
UPDATE xmlapp.person
SET info = xmlquery( 'copy $new := $INFO
modify for $j in $new/personinfo//phone return
do replace value of $j with "444-444-4444"
return $new' )
WHERE XMLEXISTS('$INFO/personinfo[name="John Wayne"]')
Correct Answer: A
Vote an answer
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>60</grade></course>
</grades>
<phone type="mobile">416-333-8725</phone>
</studentinfo>');
Given the statements shown in the exhibit, which two queries can be used to return the semester
average of the student? (Choose two.)
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>60</grade></course>
</grades>
<phone type="mobile">416-333-8725</phone>
</studentinfo>');
Given the statements shown in the exhibit, which two queries can be used to return the semester
average of the student? (Choose two.)
Correct Answer: B,D
Vote an answer
Table T1 and views V1 and V2 were created by executing the statements shown below:
CREATE TABLE t1 (c1 INT, c2 CHAR(3));
CREATE VIEW v1 AS SELECT c1, c2 FROM t1 WHERE c1 > 100;
CREATE VIEW v2 AS SELECT * FROM v1 WHERE c2 IS NULL WITH
CASCADED CHECK OPTION;
Which statement will execute successfully?
CREATE TABLE t1 (c1 INT, c2 CHAR(3));
CREATE VIEW v1 AS SELECT c1, c2 FROM t1 WHERE c1 > 100;
CREATE VIEW v2 AS SELECT * FROM v1 WHERE c2 IS NULL WITH
CASCADED CHECK OPTION;
Which statement will execute successfully?
Correct Answer: A
Vote an answer
A CLI/ODBC application uses the SQL FetchScroll() API to retrieve an updatable row set with five rows of data. Each column of the row set is bound to an array of application memory. The API is called with the SQL_FETCH_NEXT FetchOrientationoption and returns SQL_SUCCESS_WITH_INFO. Diagnostics show a truncation SQLSTATE of "01004".
Which API call correctly identifies the record with the failure?
Which API call correctly identifies the record with the failure?
Correct Answer: A
Vote an answer
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
<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
Correct Answer: D
Vote an answer
.Which combination of statements can be used to delete qualifying rows from a table named EMP?
Correct Answer: B
Vote an answer
Click the Exhibit button.
CREATE TABLE store(sid INTEGER, info XML);
INSERT INTO store VALUES (1,
'<storeinfo sid="1">
<name>Grocery A</name>
<items>
<fruit><name>Mango</name><price>1.20</price></fruit>
<fruit><name>Apple</name><price>0.50</price></fruit>
<dessert><name>Ice Cream</name><price>6.00</price></dessert>
</items>
</storeinfo>');
Given the statements shown in the exhibit, a user executes the query shown below:
XQUERY for $store in db2-fn:xmlcolumn('STORE.INFO')/storeinfolet $items := $store/items/fruit,
$count := fn:count($items) return <itemcount>$count</itemcount> What is the output?
CREATE TABLE store(sid INTEGER, info XML);
INSERT INTO store VALUES (1,
'<storeinfo sid="1">
<name>Grocery A</name>
<items>
<fruit><name>Mango</name><price>1.20</price></fruit>
<fruit><name>Apple</name><price>0.50</price></fruit>
<dessert><name>Ice Cream</name><price>6.00</price></dessert>
</items>
</storeinfo>');
Given the statements shown in the exhibit, a user executes the query shown below:
XQUERY for $store in db2-fn:xmlcolumn('STORE.INFO')/storeinfolet $items := $store/items/fruit,
$count := fn:count($items) return <itemcount>$count</itemcount> What is the output?
Correct Answer: A
Vote an answer
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?
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?
Correct Answer: A
Vote an answer
Given the application shown below:
DECLARE csr1 CURSOR WITH HOLD FOR SELECT * FROM employee;
OPEN csr1;
FETCH csr1;
COMMIT;
CLOSE csr1;
How long does cursor CSR1 remain open?
DECLARE csr1 CURSOR WITH HOLD FOR SELECT * FROM employee;
OPEN csr1;
FETCH csr1;
COMMIT;
CLOSE csr1;
How long does cursor CSR1 remain open?
Correct Answer: B
Vote an answer