A table and a sequence were created with the statements shown below: CREATE TABLE orders(oid INTEGER, info VARCHAR(200));
CREATE SEQUENCE order_num AS INTEGER
START WITH 1;
Autocommitis on and the statements shown are executed:
INSERT INTO orders VALUES (NEXT VALUE FOR order_num, 'Order A');
INSERT INTO orders VALUES (PREVIOUS VALUE FOR order_num, 'Order B');
SELECT * FROM orders;
What is the output?
A. OID INFO 2 Order A 2 Order B
B. OID INFO 1 Order A 2 Order B
C. OID INFO 0 Order A 1 Order B
D. OID INFO 1 Order A 1 Order B
正解:D
質問 2:
Which condition will prevent a developer from using the DB2 Call Level Interface in an application?
A. The application must create an external scalar function with the CREATE FUNCTION statement.
B. The developer must control the cursor names to comply with company naming standards.
C. The DECLARE CURSOR statement needs to be used.
D. An SQL precompiler is not available to the developer.
正解:C
質問 3:
While developing a Java JDBC application, you use the set of statements shown below:
Connection con;
PreparedStatementpstmt;
intnumUpd;
pstmt= con.prepareStatement("UPDATE EMPLOYEE SET PHONENO='4657' WHERE
EMPNO=?");
pstmt.setString(0, "000010");
numUpd= pstmt.executeUpdate();
pstmt.close();
Assuming a connection has already been established, which statement is true?
A. Statements will give a syntax error.
B. Statements will execute successfully, but will not update rows in the database.
C. Statements will give a runtime exception.
D. Statements will be executed successfully.
正解:C
質問 4:
.While developing a CLI application, you use the code shown below:
SQLCHAR *stmt = (SQLCHAR *)"DELETE FROM org WHERE deptnumb = ? ";
cliRC= SQLSetStmtAttr(hstmt, SQL_ATTR_DEFERRED_PREPARE,
SQL_DEFERRED_PREPARE_ON )
cliRC= SQLPrepare(hstmt, stmt, SQL_NTS);
Now, the ORG table does not exist in the database.
What will be the value of "cliRC" after executing the SQLPrepare command?
A. SQL_SUCCESS
B. SQL_SUCCESS_WITH_INFO
C. SQL_ERROR
D. SQL_INVALID_HANDLE
正解:A
質問 5:
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?
A. INSERT INTO v2 VALUES (100, 'abc')
B. INSERT INTO v2 VALUES (125, NULL)
C. INSERT INTO v2 VALUES (100, NULL)
D. INSERT INTO v2 VALUES (125, 'abc')
正解:B
質問 6:
Click the Exhibit button.
CONNECT TO test;
CREATE TABLE tab_a (col1 INT);
CREATE TABLE tab_b (col1 INT);
INSERT INTO tab_a VALUES (1), (2), (3), (4);
INSERT INTO tab_b VALUES (1), (1), (2), (2);
CONNECT RESET;
A DB2 Command Line Processor script file containing the commands and statements shown in
the exhibit was executed successfully.
If the statement shown below is executed:
UPDATE tab_a SET col1 = 10 WHERE col1 IN (SELECT * FROM tab_b);
How many rows in table TAB_A will be modified?
A. 0
B. 1
C. 3
D. 2
正解:D
尾上** -
最重要用語や問題傾向を掲載しているから気に入ってます。Pass4Test本当に有難うございます!