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.)
A. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo
let $avg := fn:avg($studinfo/grades/course)
return $avg
B. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo
let $sum := fn:sum($studinfo/grades/course/grade),
$count := fn:count($studinfo/grades/course/grade)
return $sum div $count
C. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo
let $average := fn:average($studinfo/grades/course/grade)
return $average
D. XQUERY for $studinfo in db2-fn:xmlcolumn('GRADEREPORT.INFO')/studentinfo
let $avg := fn:avg($studinfo/grades/course/grade)
return $avg
正解:B,D
質問 2:
Which statement(s) will create and bind the package for the program myprogram.sqc?
A. gcc myprogram.sqc -o myprogram BIND myprogram.bnd
B. BIND myprogram.bnd
C. PRECOMPILE myprogram.sqc
D. gcc myprogram.sqc -o myprogram REBIND myprogram.sqc
正解:C
質問 3:
Which standard is used for XML document validation in DB2?
A. XMLSchema
B. RelaxNG
C. DTD
D. Schematron
正解:A
質問 4:
.Click the Exhibit button. The database shown below exists on a remote server: Database name: MYDB Host IP: 12.34.56.78 DB2 Port: 56789 User: remote password: password This database has been cataloged on the local server with an alias of MYREMDB. You are developing a CLI/ODBC application that must establish a connection to the remote database shown in the exhibit. What are two ways by which you can connect to the database? (Choose two.)
A. SQLConnect(hdbc, "myremdb", SQL_NTS, "remote", SQL_NTS, "password", SQL_NTS)
B. SQLConnect(hdbc, "mydb", SQL_NTS, "remote", SQL_NTS, "password", SQL_NTS)
C. SQLDriverConnect(hdbc, (SQLHWND)NULL, "DSN=myremdb;UID=remote;PWD=password",
SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT)
D. SQLDriverConnect(hdbc, (SQLHWND)NULL, "DSN=mydb;UID=remote;PWD=password",
SQL_NTS,
NULL, 0,
NULL, SQL_DRIVER_NOPROMPT)
正解:A,C
質問 5:
Which two C# .NET code snippets illustrate the valid execution of a SQL statement through the IBM Data Server Provider for .NET? (Choose two.)
A. DB2Commandcmd = conn.CreateCommand();
cmd.CommandText= "SELECT fname, lname FROM employee WHERE empno=55";
DB2DataReader reader = cmd.ExecuteReader();
B. DB2Commandcmd = DB2Context.GetCommand();
DB2Transaction trans = conn.BeginTransaction();
cmd.Transaction= trans;
cmd.CommandText= "INSERT INTO employee (fname,lname) VALUES('Susan','Smith');
cmd.ExecuteNonQuery();
C. SqlCommand cmd = new SQLCommand("INSERT INTO employee (fname,lname)
VALUES('Susan','Smith')",conn);
cmd.ExecuteNonQuery();
D. SqlCommand cmd = new SQLCommand("SELECT fname, lname FROM employee WHERE
empno=55",conn);
SqlDataReaderreader = cmd.ExecuteReader();
正解:A,B
質問 6:
A JDBC application uses the "com.ibm.db2.jcc.DB2Driver" driver.
Which two JDBC code snippets illustrate establishing valid connections to a DB2 database named
MYDB? (Choose two.)
A. // Assume aDataSource object named mydb was created by the system administrator
Context ctx=new InitialContext();
DataSourceds = (DataSource)ctx.lookup("jdbc/mydb");
conn= ds.getConnection();
B. // Assume aDataSource object named mydb was created by the system administrator
DB2SimpleDataSource dbds=new DB2SimpleDataSource();
DataSourceds = (DataSource)dbds.lookup("jdbc/mydb");
conn= ds.getConnection();
C. Stringurl = "jdbc:db2://myhost:5021/mydb:user=myuser;password=mypwd;";
Connection conn = DriverManager.getConnection (url);
D. Stringurl = "jdbc:db2://myhost/mydb"
Connection conn = DriverManager.getConnection (url);
正解:A,C
質問 7:
Which CLI/ODBC function would be used to update multiple rows in a table?
A. SQLExecBatch()
B. SQLBulkUpdate()
C. SQLExecute()
D. SQLUpdate()
正解:C
名波** -
読みやすさは抜群です。出題ポイントにしぼった解説と演習で,C2090-543試験に必要な知識が効率的に身に付きますね