000-735 certification part 1

Upload: suryavanshipriyanka

Post on 03-Jun-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 000-735 Certification Part 1

    1/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 1 of 48

    Question: 1An SQL procedure uses the statement shown below to insert a record into a global temporarytable named TEMP_TABLE INSERT INTO temp_table VALUES (1, 'a') Which schema nameshould be used to qualify the temporary table in the INSERT statement?

    A. SESSIONB. DB2ADMINC. DB2USERD. SYSIBM

    Answer: A

    Question: 2Which two DB2 commands can be performed using the ADMIN_CM rocedure? (Choose two.)

    A. RUNSTATSB. BACKUPC. RESTORED. RECOVER

    E. CREATE DATABASE

    Answer: A, B

    Question: 3Which statement describes what must be done to create an SQL procedure that returns a resultset?

    A. Specify the clause DYNAMIC RESULT SETS 1 in the CREATE PROCEDURE statement;declare a cursor within the procedure body; open the cursor; exit the procedure without closingthe cursor.

    B. Specify the clause DYNAMIC RESULT SETS 1 in the CREATE PROCEDURE statement;code a SELECT statement in the procedure body.

    C. Execute the CREATE PROCEDURE statement using the defaults; declare a cursor within theprocedure body; open the cursor; exit the procedure without closing the cursor.

    D. Execute the CREATE PROCEDURE statement using the defaults; declare a cursor within theprocedure body; open the cursor; retrieve each row into output variables; close the cursorbefore exiting the procedure.

    Answer: A

    Question: 4A database developer using Data Studio needs to view sample data in a table. Which view shouldbe used?

    A. Database Explorer

    B. Data Project ExplorerC. Data OutputD. Properties

    Answer: A

    Question: 5Given the function shown below, what is the output of the statement:VALUES LENGTH(fcn1(' one good day '))?CREATE FUNCTION fcn1(v1 VARCHAR(50))

  • 8/12/2019 000-735 Certification Part 1

    2/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 2 of 48

    RETURNS VARCHAR(50)RETURN LTRIM(RTRIM(v1));

    A. 'one good day'B. 12C. ' one good day 'D. 14

    Answer: B

    Question: 6Which statement can be used to declare a variable inside an SQL procedure that can be used torepresent a monetary value?

    A. DECLARE v_money MONEY;B. DECLARE v_money DOUBLE;C. DECLARE v_money DECIMAL(9,2);D. DECLARE v_money CURRENCY;

    Answer: C

    Question: 7Click the Exhibit button.

    A user-defined function was created using the statement shown in the exhibit. Which additionaloption can be added to the CREATE FUNCTION statement to tell the optimizer that functiondoes not always return the same results for a given argument value?

    A. NO EXTERNAL ACTIONB. NOT FENCEDC. NOT DETERMINISTICD. STATIC DISPATCH

  • 8/12/2019 000-735 Certification Part 1

    3/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 3 of 48

    Answer: C

    Question: 8In which type of table space must global temporary tables be created?

    A. REGULARB. LONGC. SYSTEM TEMPORARYD. USER TEMPORARY

    Answer: D

    Question: 9Which statement should be used to declare an array with at most 10 elements of type INTEGER?

    A. DECLARE sub_total INTEGER[10];B. DECLARE sub_total[10] INTEGER;C. CREATE TYPE sub_total AS INTEGER[10];

    D. CREATE TYPE sub_total[10] AS INTEGER;

    Answer: C

    Question: 10Click the Exhibit button.

    A developer attempted to create a procedure to determine the oldest employee celebrating abirthday in a particular month by executing the SQL statement shown in the exhibit. Tests showthe procedure does not work as planned. What are two ways to make the procedure work asintended? (Choose two.)

  • 8/12/2019 000-735 Certification Part 1

    4/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 4 of 48

    A. Add the statement LSE RETURN; before the statement AND IF;B. Change the statement ALSEIF UCASE(b_month) != UCASE(month) THEN to ALSEIF

    UCASE(b_month) = UCASE(month) THENC. Add the statement ALSE BREAK; before the statement AND IF;D. Change the statement ALSEIF UCASE(b_month) != UCASE(month) THEN ITERATE

    this_loop; to ALSEIF UCASE(b_month) = UCASE(month) THEN LEAVE this_loop;?E. Add the statement ALSE CONTINUE; before the statement AND IF;

    Answer: A, D

    Question: 11Click the Exhibit button. How many rows will be in table INFO2 after the procedure MOVE_DATA

    shown in the exhibit is executed?

  • 8/12/2019 000-735 Certification Part 1

    5/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 5 of 48

    A. 0B. 4

    C. 5D. 7

    Answer: B

    Question: 12Click the Exhibit button. Referring to the exhibit, how many rows will be returned by the SQLquery shown below?SELECT * FROM TABLE(getnumemployee(21) AS d

  • 8/12/2019 000-735 Certification Part 1

    6/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 6 of 48

    A. 0B. 1C. 7

    D. 10

    Answer: C

    Question: 13Which two statements are true when working with triggers? (Choose two.)

    A. Triggers can be used to enforce data integrity rules.

  • 8/12/2019 000-735 Certification Part 1

    7/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 7 of 48

    B. Triggers can be used with both tables and views.C. Triggers can be altered.D. Triggers can be used on Materialized Query Tables.E. Triggers can be defined using Java or C.

    Answer: A, B .

    Question: 14Click the Exhibit button.

    If the three procedures were built as shown in the exhibit, what will take place if an applicationinvokes SQL procedure PROCMAIN?

    A. 0 result sets are returned.B. 1 result set is returned.C. 1 result set is returned with a warning.D. 2 result sets are returned with a warning.

    Answer: B

    Question: 15Which SQL procedure declaration is valid?

    A. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)BEGINDECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';

  • 8/12/2019 000-735 Certification Part 1

    8/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 8 of 48

    DECLARE my_cur CURSOR FORSELECT * FROM employee;DECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;SET a = a * multp;DECLARE b INTEGER;b = a *1.7;SET p_code = b;END

    B. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)BEGINDECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;DECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';DECLARE my_cur CURSOR FORSELECT * FROM employee;SET a = a * multp;

    SET p_code = a;END

    C. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)BEGINDECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE my_cur CURSOR FORSELECT * FROM employee;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';DECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;SET a = a * multp;SET p_code = a;

    ENDD. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)

    BEGINDECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';DECLARE my_cur CURSOR FORSELECT * FROM employee;DECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;SET a = a * multp;SET p_code = a;END

    Answer: D

    Question: 16Which statement will assign the schema names "SYSIBM", "SYSFUN", "SYSPROC", and"SYSIBMADM" to the CURRENT_PATH special register?

    A. SET PATH = SYSTEM PATHB. SET CURRENT_PATH = DEFAULTC. SET PATH = SYSTEM DEFAULT

  • 8/12/2019 000-735 Certification Part 1

    9/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 9 of 48

    D. RESET CURRENT PATH

    Answer: A

    Question: 17There is no row change timestamp column defined on a table. An original row is selected,another row is updated on the same page after the SELECT and before the UPDATE. WithOptimistic

    A. The row change token predicate succeeds for the selected row because the row change tokenvalue for all rows on the page has changed except for the original row, so the UPDATEstatement succeeds for the original row.

    B. The row change token predicate fails because the row change token value for all rows on thepage has changed, however the UPDATE statement succeeds since the original row has notactually changed.

    C. The row change token predicate fails because the row change token value for all rows on theage has changed, so the UPDATE statement fails to find a row even though the original rowhas not actually changed.

    D. The row change token predicate is implicitly updated because the row change token value for

    all rows on the page has changed, so the UPDATE statement fails to find a row even thoughtheoriginal row has not actually changed.

    Answer: C

    Question: 18Which three statements are true about SQL procedures? (Choose three.)

    A. SQL procedures reside outside of the database for easy portability.B. SQL procedures can be called from triggers.C. SQL procedures may return multiple result sets to the caller or to a client application.D. SQL procedures support recursion.

    E. SQL procedures support the PRINT statement.

    Answer: B, C, D

    Question: 19Which statement will successfully create an SQL procedure that returns the name of the currentmonth?

    A. CREATE PROCEDURE proc.current_month(OUT month VARCHAR(20))BEGINDECLARE today DATE;SET (today = CURRENT_DATE);SET month = MONTHNAME(today);

    ENDB. CREATE PROCEDURE proc.current_month(OUT month VARCHAR(20))BEGINDECLARE today DATE;SELECT (CURRENT_DATE) INTO today;SET month = MONTHNAME(today);END

    C. CREATE PROCEDURE proc.current_month(OUT month VARCHAR(20))BEGINDECLARE today DATE;

  • 8/12/2019 000-735 Certification Part 1

    10/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 10 of 48

    VALUES (CURRENT_DATE) INTO today;SET month = MONTHNAME(today);END

    D. CREATE PROCEDURE proc.current_month(OUT month VARCHAR(20))BEGINSET month = MONTHNAME(SELECT (CURRENT_DATE))END

    Answer: C

    Question: 20Click on the Exhibit button.

    Referring to the exhibit, what is the OUT_PHONENUMBERS result set when the SQL procedureis invoked by the call statement shown below?CALL find_customers(ARRAY[16-305-374505-414-456516-305-3746'905-414-4566'],

    16 )

    A. [?16-305-3745??05-414-4565? ?16-305-3746']B. [?16-305-3745??05-414-4565? ?16-305-3746? '905-414-4566']C. [?05-414-4565? '905-414-4566']D. [?16-305-3745? ?16-305-3746[?16-305-3745? ?16-305-3746?

    Answer: D

  • 8/12/2019 000-735 Certification Part 1

    11/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 11 of 48

    Question: 21Click the Exhibit button. Which statement correctly describes the result of the FOR loop shown inthe exhibit?

    A. FULLNAME is set to the last name of the employee, followed by a comma, the first name, ablank space, and the middle initial. Only the last value for FULLNAME is inserted into tableTNAMES.

    B. FULLNAME is set to the last name of the employee, followed by a comma, the first name, ablank space, and the middle initial. Only the first value for FULLNAME is inserted into tableTNAMES.

    C. FULLNAME is set to the last name of the employee, followed by a comma, the first name, ablank space, and the middle initial for each row. Each value for FULLNAME is inserted intotabl

    TNAMES in alphabetical order.D. FULLNAME is set to the last name of the employee, followed by a comma, the first name, a

    blank space, and the middle initial for each row. Each value for FULLNAME is inserted intotableTNAMES.

    Answer: D

    Question: 22Given the statements shown below:DECLARE c_dept CURSOR WITH HOLD FORSELECT * FROM dept;

    OPEN c_dept;Which two conditions are true? (Choose two.)-

    A. C_DEPT will remain open after a ROLLBACK.B. C_DEPT will remain open after a COMMIT.C. C_DEPT will be returned to the caller of the routine.D. C_DEPT will be positioned before the next logical row.E. All locks held by C_DEPT will be released after a COMMIT.

  • 8/12/2019 000-735 Certification Part 1

    12/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 12 of 48

    Answer: B, D

    Question: 23Which two return types can be used in the RETURN clause of the CREATE FUNCTIONstatement? (Choose two.)

    A. VARCHAR(10)B. TABLEC. RECORDD. XMLE. ARRAY

    Answer: A, B

    Question: 24Which two statements are true with regards to nesting SQL procedures?(Choose two.)

    A. An SQL procedure cannot invoke procedures built in other languages (e.g., C, Java).

    B. An SQL procedure can invoke the same SQL procedure more than once.C. An SQL procedure defined with the CONTAINS SQL clause can invoke an SQL procedure

    defined with the READS SQL DATA clause.D. An SQL procedure defined with the CONTAINS SQL clause can invoke an SQL procedure

    defined with the MODIFIES SQL DATA clause.E. An SQL procedure defined with the CONTAINS SQL clause can invoke an SQL procedure

    defined with the NO SQL clause.

    Answer: B, E

    Question: 25There is no row change timestamp column defined on a table. An original row is selected, anotherrow is updated on the same page after the SELECT and before the UPDATE. With Optimistic

    Locking, what is the result?

    A. The row change token predicate succeeds for the selected row because the row change tokenvalue for all rows on the page has changed except for the original row, so the UPDATEstatement succeeds for the original row.

    B. The row change token predicate fails because the row change token value for all rows on thepage has changed, however the UPDATE statement succeeds since the original row has notactually changed.

    C. The row change token predicate fails because the row change token value for all rows on thepage has changed, so the UPDATE statement fails to find a row even though the original rowhas not actually changed.

    D. The row change token predicate is implicitly updated because the row change token value forall rows on the page has changed, so the UPDATE statement fails to find a row even though

    the original row has not actually changed.

    Answer: C

    Question: 26Click the Exhibit button. Given the two SQL procedures shown in the exhibit, what is theexpected output if procedure S1 is invoked with the value 1 provided for parameter V1

  • 8/12/2019 000-735 Certification Part 1

    13/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 13 of 48

    A. NULLB. 2C. 5D. 7

    Answer: D

    Question: 27Click on the Exhibit button. Referring to the exhibit, what is the OUT_PHONENUMBERS resultset when the SQL procedure is invoked by the call statement shown below?CALL find_customers(ARRAY[16-305-374505-414-456516-305-3746'905-414-4566'],16)

  • 8/12/2019 000-735 Certification Part 1

    14/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 14 of 48

    A. [?16-305-3745??05-414-4565? ?16-305-3746']B. [?16-305-3745??05-414-4565? ?16-305-3746? '905-414-4566']C. [?05-414-4565? '905-414-4566']D. [?16-305-3745? ?16-305-3746[?16-305-3745? ?16-305-3746?

    Answer: D

    Question: 28Click the Exhibit button. How many distinct rows would be in table T1 if the statements in theexhibit were executed?

  • 8/12/2019 000-735 Certification Part 1

    15/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 15 of 48

    A. 3

    B. 7C. 9D. 10

    Answer: B

    Question:29An independent software vendor (ISV) uses proprietary and confidential logic in their SQLprocedure bodies and does not want their customers to be able to view their contents. Whichstatement correctly describes how the ISV can protect their code when they deploy it at customersites?

    A. Use the PUT_ROUTINE() and GET_ROUTINE() SQL procedures.

    B. Enable obfuscation using the DB2_SQLROUTINE_PREPOPTS DB2 registry variable.C. Use the ENCRYPT_ROUTINE() and DECRYPT_ROUTINE() SQL procedures.D. There is no way to obfuscate SQL procedure logic.

    Answer: A

    Question: 30Given the SQL statement shown below:CREATE TRIGGER hr.raise_limit

    AFTER UPDATE OF salary ON employeeREFERENCING NEW AS n OLD AS oFOR EACH ROWWHEN (n.salary > 1.1 * o.salary)

    SIGNAL SQLSTATE '75000' SET MESSAGE_TEXT='Salary increase>10%'Which two privileges allow a user to execute the CREATE TRIGGER statement shown? (Choosetwo.)

    A. DBADM authorityB. SYSCTRL authorityC. SELECT and UPDATE privilege on the EMPLOYEE tableD. SYSMAINT authorityE. SELECT and ALTER privilege on the EMPLOYEE table

  • 8/12/2019 000-735 Certification Part 1

    16/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 16 of 48

    Answer: A, C

    Question: 31Which statement can be used to define an array of 30 names that have a maximum size of 25characters each?

    A. CREATE TYPE names AS VARCHAR(25) ARRAY[30];B. CREATE ARRAY names[30] VARCHAR(25);C. CREATE TYPE names[30] VARCHAR(25);D. CREATE ARRAY names AS VARCHAR(25);

    Answer: A

    Question: 32Which two belong within a compound statement? (Choose two.)

    A. connect statementB. flow statementC. condition declaration

    D. function declarationE. cursor declaration

    Answer: C, E

    Question: 33A developer needs to create a user-defined function that will return a list of employees who workin a particular department. Which statement will successfully create a function that meets thisobjective?

    A. CREATE FUNCTION dept_employees (deptno CHAR(3))RETURNS TABLELANGUAGE SQL

    READS SQL DATARETURNSELECT empno, lastname AS l_name, firstnme AS f_nameFROM employeeWHERE employee.workdept = dept_employees.deptno

    B. CREATE FUNCTION dept_employees (deptno CHAR(3))RETURNS TABLEDYNAMIC RESULT SETS 1LANGUAGE SQLREADS SQL DATADECLARE emp_info CURSOR WITH RETURN FORSELECT empno, lastname AS l_name, firstnme AS f_nameFROM employee

    WHERE employee.workdept = dept_employees.deptnoOPEN emp_info;RETURN

    C. CREATE FUNCTION dept_employees (deptno CHAR(3))RETURNS TABLE (empno CHAR(6),l_name VARCHAR(15),f_name VARCHAR(12))LANGUAGE SQLREADS SQL DATARETURN

  • 8/12/2019 000-735 Certification Part 1

    17/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 17 of 48

    SELECT empno, lastname AS l_name, firstnme AS f_nameFROM employeeWHERE employee.workdept = dept_employees.deptno

    D. CREATE FUNCTION dept_employees (deptno CHAR(3))RETURNS TABLE (empno CHAR(6),l_name VARCHAR(15),f_name VARCHAR(12))DYNAMIC RESULT SETS 1LANGUAGE SQLREADS SQL DATADECLARE emp_info CURSOR WITH RETURN FORSELECT empno, lastname AS l_name, firstnme AS f_nameFROM employeeWHERE employee.workdept = dept_employees.deptnoOPEN emp_info;RETURN

    Answer: C

    Question: 34Given the statement shown below:CREATE TRIGGER new_hired

    AFTER INSERT ON employeeFOR EACH ROWUPDATE empsumm SET empsumm.no_of_employees = emptest.no_of_employees + 1Which statement will fire the resulting trigger?

    A. CALL TRIGGER new_hired('0010')B. INSERT INTO employee VALUES('0010', 'john doe', 30000.00, 50)C. TRIGGER new_hired(employee)D. SELECT TRIGGER new_hired FROM employee

    Answer: B

    Question: 35Which statement is permitted within a scalar user-defined function body?

    A. COMMITB. INSERTC. SIGNALD. LOOP

    Answer: C

    Question: 36

    What is a reason to use SQL procedures in DB2?

    A. to use different programming languagesB. to reduce code sharingC. to reduce network trafficD. to eliminate the need for testing

    Answer: C

    Question: 37

  • 8/12/2019 000-735 Certification Part 1

    18/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 18 of 48

    Using Optimistic Locking, both Transaction 1 and Transaction 2 have read the same rowincluding the RID_BIT and ROW CHANGE TOKEN values. Transaction 1 updates the row after ethat same row using the same predicate as transaction 1. What will be the result?

    A. The row will be found with the same ROW CHANGE TOKEN. Transaction 2 will now insert itsvalues replacing those of transaction 1.

    B. The row will be found with a different ROW CHANGE TOKEN and Transaction 2 will overwritethe values set in transaction 1.

    C. The row will not be found because the value of the ROW CHANGE TOKEN has changed inregard to the UPDATE of transaction 1. Transaction 2 has to retry in order to retrieve thecurrent data.

    D. The row will not be found because the value of the ROW CHANGE TOKEN has changed inregard to the UPDATE of transaction 1. Transaction 2 will complete with an insert of a newrow.

    Answer: C

    Question: 38Which three optional clauses can be used when creating an external function? (Choose three.)

    A. SCRATCHPADB. NOTEPADC. LANGUAGED. EXTERNAL NAMEE. DATABASEINFO

    Answer: A, C, D

    Question: 39Which SQL procedure declaration is valid?

    A. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)

    BEGINDECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';DECLARE my_cur CURSOR FORSELECT * FROM employee;DECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;SET a = a * multp;DECLARE b INTEGER;b = a *1.7;SET p_code = b;END

    B. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)BEGINDECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;DECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';DECLARE my_cur CURSOR FORSELECT * FROM employee;SET a = a * multp;

  • 8/12/2019 000-735 Certification Part 1

    19/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 19 of 48

    SET p_code = a;END

    C. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)BEGINDECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE my_cur CURSOR FORSELECT * FROM employee;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';DECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;SET a = a * multp;SET p_code = a;END

    D. CREATE PROCEDURE myproc(IN multp INTEGER, OUT p_code INTEGER)BEGINDECLARE SQLSTATE CHAR(5);DECLARE a INTEGER;DECLARE c_duplicate CONDITION FOR SQLSTATE '23505';

    DECLARE my_cur CURSOR FORSELECT * FROM employee;DECLARE EXIT HANDLER FOR SQLEXCEPTIONSET p_code = 0;SET a = a * multp;SET p_code = a;END

    Answer: D

    Question: 40What will be the initial value of V_MAX in the declaration statement shown below?DECLARE v_max DECIMAL(9,2);

    A. 0.0B. 2C. 9D. NULL

    Answer: D

    Question: 41How is the FOR statement distinct from other conditional statements?

    A. FOR statements are evaluated at the completion of each iteration of the loop.B. FOR statements are evaluated before each iteration of the loop.

    C. FOR statements have a terminating condition clause.D. FOR statements are used to iterate over rows in a defined read-only result set.

    Answer: D

    Question: 42Click the Exhibit button.Refer to the procedure shown in the exhibit and the trigger shown below.CREATE TRIGGER sal_limitBEFORE UPDATE ON employee

  • 8/12/2019 000-735 Certification Part 1

    20/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 20 of 48

    REFERENCING NEW AS nFOR EACH ROWWHEN (n.salary > (SELECT max_salary FROM salary_limits WHERE job_desc = n.job) +gl_sal_increase)SIGNAL SQLSTATE '78000' SET MESSAGE_TEXT = 'Salary is too big';If the procedure SAL_INCREASE_LIM is called, which two statements are true? (Choose two.)

    A. Global variables are not supported within the trigger.B. The result of the procedure will depend on the value of MAX_SALARY in the table

    SALARY_LIMITS.C. The result of the procedure will depend on the value for HIREDATE column for the employee

    that is being updated.D. The result of the procedure will depend on the value GL_SAL_INCREASE for the employee

    that is being updated.E. This trigger would not be activated.

    Answer: B, C

    Question: 43

    You want to see the explain plan for all SQL statements used in your SQL procedures. Whichtwo statements will allow you to obtain the explain plan? (Choose two.)

    A. Copy SQL statements from the SQL procedure and paste into the Control Center, CommandEditor, or Data Studio explain facility.

    B. Use the DB2SET command to globally set DB2_SQLROUTINE_PREPOPTS="EXPLAIN YESEXPLSNAP YES" .

    C. Call SYSPROC.SET_ROUTINE_OPTS('EXPLAIN YES EXPLSNAP YES') to set explainparameters for a session and compile the SQL procedure. Run the db2expl or db2exfmt tool tocapture the explain plan.

  • 8/12/2019 000-735 Certification Part 1

    21/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 21 of 48

    D. Call SYSPROC.REBIND_ROUTINE_PACKAGE and specify 'EXPLAIN YES EXPLSNAP YES'bind option. Run the db2expl or db2exfmt tool to capture explain plan.

    E. Call SYSPROC.SET_ROUTINE_OPTS('EXPLAIN YES EXPLSNAP YES') to set explainparameters for a session and compile the SQL procedure.

    Answer: A, C

    Question: 44Which two statements describe characteristics of external functions? (Choose two.)

    A. External functions cannot return tables.B. All cursors opened within an external function should stay open until the database is quiesced.C. Dynamic allocations of memory in an external routine should be freed before the external

    routine returns.D. Scratchpads can be used to allocate dynamic memory required for multiple function

    invocations.E. Transactions can be terminated within external functions.

    Answer: C, D

    Question: 45Click the Exhibit button. A user-defined function was created using the statement shown in theexhbit. What are two valid ways to invoke this function from the DB2 Command Line Processor?(Choose two.)

    A. SELECT lastname, e_degree(edlevel) AS degree FROM employeeB. SELECT * FROM e_degree(SMALLINT(18))C. VALUES e_degree(18)D. VALUES e_degree(SMALLINT(18))

  • 8/12/2019 000-735 Certification Part 1

    22/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 22 of 48

    E. SELECT * FROM TABLE(e_degree(SMALLINT(18))

    Answer: A, D

    Question: 46Which steps must be followed to return a result set from an SQL procedure?

    A. 1. Create the procedure using the DYNAMIC RESULT SETS clause.2. Declare the cursor.3. Open the cursor in the SQL procedure.4. Close the cursor.5. Return to the application.

    B. 1. Create the procedure using the DYNAMIC RESULT SETS clause.2. Declare the cursor using the WITH RETURN clause.3. Open the cursor in the SQL procedure.4. Return to the application.

    C. 1. Create the procedure using the WITH RETURN clause.2. Declare the cursor using the DYNAMIC RESULT SETS clause.3. Open the cursor in the SQL procedure.

    4. Return to the application.D. 1. Create the procedure using the WITH RETURN clause.

    2. Declare the cursor using the DYNAMIC RESULT SETS clause.3. Open the cursor in the SQL procedure.4. Close the cursor.

    Answer: B

    Question: 47Click the Exhibit button.Which statement can be used to invoke the function in the exhibit?

    A. SELECT * FROM TABLE(fcn1('B01'))B. SELECT TABLE(fcn1('B01')) FROM SYSIBM.SYSDUMMY1C. SELECT * FROM fcn1('B01')D. SELECT fcn1('B01') FROM SYSIBM.SYSDUMMY1

    Answer: A

    Question: 48

  • 8/12/2019 000-735 Certification Part 1

    23/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 23 of 48

    Click the Exhibit button. An SQL procedure was created using the statement shown in the exhibit.What is the correct way to invoke this procedure from the DB2 Command Line Processor?

    A. CALL proc.conv_temp(98.6, 'F-C', 0)B. SELECT location, proc.conv_temp(temp, 'F-C', 0) AS temp FROM geo_dataC. CALL proc.conv_temp(98.6, 'F-C', 0)D. SELECT location, proc.conv_temp(temp, 'F-C') AS temp FROM geo_data

    Answer: C

    Question: 49

    Click the Exhibit button. Given that the statements in the exhibits have executed successfully,which solution contains the complete set of commands that could be used to drop bothprocedures in the order presented?

  • 8/12/2019 000-735 Certification Part 1

    24/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 24 of 48

    A. DROP PROCEDURE testp;B. DROP PROCEDURE testp;

    DROP PROCEDURE testproc;C. DROP SPECIFIC PROCEDURE testproc;

    DROP PROCEDURE testproc;D. DROP PROCEDURE testproc(INT);

    DROP PROCEDURE testproc(INT);

    Answer: C

    Question:50Which CREATE PROCEDURE statement option should be used if you plan on issuing aDECLARE GLOBAL TEMPORARY TABLE statement from within the SQL procedure body?

    A. CONTAINS SQLB. READS SQL DATAC. MODIFIES SQL DATAD. LANGUAGE SQL

    Answer: C

    Question: 51Which statement will change the value of a special register?

    A. UPDATE SPECIAL REGISTER TIME = 2:30:00B. UPDATE SPECIAL REGISTER SCHEMA = 'DB2ADMIN'C. SET CURRENT TIME = 2:30:00D. SET CURRENT SCHEMA = 'DB2ADMIN'

  • 8/12/2019 000-735 Certification Part 1

    25/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 25 of 48

    Answer: D

    Question: 52Which statement is true for a global temporary table?

    A. Results from manipulation of the data cannot to be stored temporarily in a table.B. A user temporary table space must exist before global temporary tables can be created.C. The data in the temporary table continues to persist after termination and disconnection from

    the database.D. Global temporary tables can be created on demand.

    Answer: B

    Question: 53Click the Exhibit button. In the exhibit, the code for an SQL user-defined function is contained inthe file func1.db2. What is the correct command to build this function from the command line?

    A. db2 d! f dept_salary()B. db2 d! f func1.db2C. db2 vf func1.db2D. db2 vf f get_dept_sal

    Answer: B

    Question: 54Which two DB2 privileges are required to issue a CREATE PROCEDURE statement, assumingthe SCHEMA name used for the SQL procedure already exists? (Choose two.)

    A. EXECUTE privilege on any dependent SQL proceduresB. BINDADD privilege on the databaseC. BIND privilege on the databaseD. SECADM authority on the databaseE. CREATEIN privilege on the schema

    Answer: B, E

    Question: 55What demonstrates the correct syntax for assigning three rows to the EMPNO, FIRSTNAME, andLASTNAME columns of a table named EMPLOYEE?

    A. INSERT INTO employee (empno, firstname, lastname)VALUES (100, 200, 300, 'John', 'Jane', 'Paul', 'Doe', 'Smith', 'Jones')

    B. INSERT INTO employee (empno, firstname, lastname)

  • 8/12/2019 000-735 Certification Part 1

    26/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 26 of 48

    VALUES (100, 'John', 'Doe'), (200, 'Jane', 'Smith'), (300, 'Paul', 'Jones')C. SET (empno, firstname, lastname)

    VALUES (100, 200, 300, 'John', 'Jane', 'Paul', 'Doe', 'Smith', 'Jones')FOR employee

    D. SET (empno, firstname, lastname)VALUES (100, 'John', 'Doe'), (200, 'Jane', 'Smith'), (300, 'Paul', 'Jones')FOR employee

    Answer: B

    Question: 56Your QA team is testing an OLTP application and several SQL procedures from your reportingapplication. To improve concurrency with other OLTP applications, they want to test a few of yourreporting SQL procedures with the isolation level uncommitted read (UR). What are two correctsolutions? (Choose two.)

    A. Use the command "SET CURRENT ISOLATION LEVEL UNCOMMITTED READ" in yourrequired SQL procedures code and recompile them.

    B. Set the DB2SET command to set DB2_SQLROUTINE_PREPOPTS="ISOLATION UR" at the

    instance level.C. Set the WITH UR option in your SELECT statement in your required SQL procedure code and

    recompile.D. CALL SYSPROC.SET_ROUTINE_OPTS('ISOLATION UR') before recompiling the required

    SQL procedure without making any changes in the SQL procedure code.E. CALL SYSPROC.REBIND_ROUTINE_PACKAGE('P','schema.procedurename','ISOLATION

    UR') for each required SQL procedure without making any changes in the SQL procedurecode.

    Answer: C, D

    Question: 57Which two actions are supported by Data Studio in the SQL procedure lifecycle? (Choose two.)

    A. Create global temporary tables to use in the SQL procedure.B. Debug the SQL procedure.C. Deploy the SQL procedure.D. Use auto complete SQL statements.E. Create user-define types in the SQL procedure.

    Answer: B, C

    Question: 58Which two SQL statements are allowed for a BEFORE trigger? (Choose two.)

    A. INSERT

    B. CALLC. MERGED. SIGNALE. UPDATE

    Answer: B, D

    Question: 59Which CREATE TRIGGER statement is valid?

  • 8/12/2019 000-735 Certification Part 1

    27/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 27 of 48

    A. CREATE TRIGGER test1NO CASCADE AFTER INSERT ON employeeREFERENCING NEW AS nFOR EACH ROWMODE DB2SQLWHEN (n.bonus IS NULL)SET n.salary = n.salary + 2000

    B. CREATE TRIGGER test1NO CASCADE BEFORE INSERT ON employeeREFERENCING NEW AS nFOR EACH ROWMODE DB2SQLWHEN (n.bonus IS NULL)SET n.salary = n.salary + 2000

    C. CREATE TRIGGER test1AFTER DELETE ON employeeREFERENCING OLD_TABLE AS oldemployeeFOR EACH STATEMENTMODE DB2SQL

    DELETE FROM staffWHERE id IN (SELECT empno FROM oldemployee)

    D. CREATE TRIGGER test1NO CASCASE BEFORE DELETE ON employeeFOR EACH STATEMENTMODE DB2SQLDELETE FROM staffWHERE id IN (SELECT empno FROM oldemployee)

    Answer: B

    Question: 60Click the Exhibit button. Given the SQL procedure definition shown in the exhibit, what will the

    value of the P_OUT parameter be if the procedure is invoked with a value of 11 for the P_INparameter?

  • 8/12/2019 000-735 Certification Part 1

    28/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 28 of 48

    A. 3B. 29C. 99D. NULL

    Answer: D

    Question: 61The CREATE PROCEDURE statement shown below was executed against a database called

    MYDB CREATE PROCEDURE myschema.proc1(IN p1 INTEGER, OUT p2 CHAR(4), OUT p3SMALLINT) BEGIN SET p2 = 'abc'; END Which two CREATE PROCEDURE statements, whenexecuted against the same database, will succeed?(Choose two.)

    A. CREATE PROCEDURE myschema.proc1(IN p1 CHAR(4), OUT p2 INTEGER)BEGINSET p2 = 123;END

    B. CREATE PROCEDURE myschema.proc1(IN p1 INTEGER, OUT p2 CHAR(4), OUT p3CHAR(4)) BEGIN SET p2 = 'abc'; END

    C. CREATE PROCEDURE myschema.proc1(IN p1 CHAR(4), OUT p2 INTEGER, OUT p3SMALLINT) BEGINSET p2 = 123; END

    D. CREATE PROCEDURE otherschema.proc1(IN p1 CHAR(4), OUT p2 CHAR(4), OUT p3CHAR(4)) BEGIN SET p2 = 'abc'; END

    E. CREATE PROCEDURE myschema.proc1(IN p1 NUMBER, OUT p2 NUMBER, OUT p3NUMBER) BEGIN SET p2 = 'abc'; END

    Answer: A, D

    Question: 62

  • 8/12/2019 000-735 Certification Part 1

    29/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 29 of 48

    Click the Exhibit button. If the procedure TEST1 shown in the exhibit is called with the value 'A00'specified for the SOMEID parameter, what is the expected return code?

    A. 0B. -1C. -2D. -3

    Answer: A

    Question: 63Given the variable declaration shown below:DECLARE v_mytime TIME;Which statement will assign a value to the variable named V_MYTIME?

    A. SET v_mytime = TIME;B. VALUES CURRENT TIME INTO v_mytime;

  • 8/12/2019 000-735 Certification Part 1

    30/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 30 of 48

    C. VALUES CURRENT TIMESTAMP INTO v_mytime;D. SET v_mytime = DATE;

    Answer: B

    Question: 64Which two procedures demonstrate the correct use of dynamic SQL? (Choose two.)

    A. CREATE PROCEDURE update_count1 (IN new_count INTEGER, IN item_code INTEGER)BEGINDECLARE v_dynSQL VARCHAR(200);SET v_dynSQL = 'UPDATE stock SET quantity_on_hand=? WHERE item_number=?';PREPARE v_stmt1 FROM v_dynSQL;EXECUTE v_stmt1 USING new_count, item_code;END

    B. CREATE PROCEDURE update_count2 (IN tab_name VARCHAR(128), IN new_countINTEGER, IN item_code INTEGER)BEGINDECLARE v_dynSQL VARCHAR(200);

    SET v_dynSQL = 'UPDATE ? SET quantity_on_hand=? WHERE item_number=?';PREPARE v_stmt1 FROM v_dynSQL;EXECUTE v_stmt1 USING tab_name, new_count, item_code;END

    C. CREATE PROCEDURE update_count3 (IN new_count INTEGER, IN item_code INTEGER)BEGINDECLARE v_dynSQL VARCHAR(200);SET v_dynSQL = 'UPDATE stock SET quantity_on_hand=' || CHAR(new_count) || ' WHEREitem_number=' ||CHAR(item_code);EXECUTE IMMEDIATE v_dynSQL;END

    D. CREATE PROCEDURE update_count4 (IN tab_name VARCHAR(128), IN col_name1

    VARCHAR(128), IN col_name2 VARCHAR(128), IN new_count INTEGER, IN item_codeINTEGER) BEGIN DECLARE v_dynSQL VARCHAR(200); SET v_dynSQL = 'UPDATE ? SET?=? WHERE ?=?'; PREPARE v_stmt1 FROM v_dynSQL; EXECUTE v_stmt1 USINGtab_name, col_name1, new_count, col_name2, item_code; END

    E. CREATE PROCEDURE update_count5 (IN new_count INTEGER, IN item_code INTEGER)BEGIN DECLARE v_dynSQL VARCHAR(200); DECLARE v_col_name VARCHAR(128);SET_col_name = 'item_number';SE v_dynSQL = 'UPDATE stock SET quantity_on_hand=? WHERE ?=?'; PEPARE v_stmt1FROM v_dynSQL; EXECUTE v_stmt1 USING new_count, v_col_name, item_code; END

    Answer: A, C

    Question: 65

    Click the Exhibit button. A trigger was created as shown in the exhibit. The UPDATE statementshown below is executed. UPDATE dept SET sales_id = '300' WHERE sales_id = '200' Howmany row(s) are updated in the EMPLOYEE table?

  • 8/12/2019 000-735 Certification Part 1

    31/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 31 of 48

    A. 0B. 1C. 2D. 3

    Answer: B

    Question: 66what demonstrates the correct syntax for assigning three rows to theEMPNO, FIRSTNAME, and LASTNAME columns of a table named EMPLOYEE?

    A. INSERT INTO employee (empno, firstname, lastname)VALUES (100, 200, 300, 'John', 'Jane', 'Paul', 'Doe', 'Smith', 'Jones')

    B. INSERT INTO employee (empno, firstname, lastname)VALUES (100, 'John', 'Doe'), (200, 'Jane', 'Smith'), (300, 'Paul', 'Jones')

    C. SET (empno, firstname, lastname)VALUES (100, 200, 300, 'John', 'Jane', 'Paul', 'Doe', 'Smith', 'Jones')FOR employee

    D. SET (empno, firstname, lastname)VALUES (100, 'John', 'Doe'), (200, 'Jane', 'Smith'), (300, 'Paul', 'Jones')

  • 8/12/2019 000-735 Certification Part 1

    32/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 32 of 48

    FOR employee

    Answer: B

    Question: 67What are two valid DECLARE statements in an SQL procedure? (Choose two.)

    A. DECLARE var1 INTEGER;B. DECLARE var1 DECIMAL [9];C. DECLARE var1 XML;D. DECLARE var1 CURRENT DATE;E. DECLARE var1[10] INTEGER;

    Answer: A, C

    Question: 68Click the Exhibit button. A DB2 Command Line Processor (CLP) file contains the set ofstatements shown in the exhibit. What does this sequence of statements illustrate?

    A. work identityB. row sequencingC. row change tokenizingD. optimistic locking

    Answer: D

    Question: 69Click the Exhibit button. Given the code segment shown in the exhibit, which statementaccurately describes the result?

  • 8/12/2019 000-735 Certification Part 1

    33/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 33 of 48

    A. For activities whose description has not changed, update the description in the ARCHIVEtable. For new activities, insert into the ARCHIVE table. The ARCHIVE and ACTIVITIES tableboth have ACTIVITY as a primary key.

    B. For activities whose description has changed, update the description in the ARCHIVE table.For new activities, insert into the ARCHIVE table. The ARCHIVE and ACTIVITIES table bothhave ACTIVITY as a primary key.

    C. For activities whose description has changed, update the description in the ACTIVITY table.

    For new activities, insert into the ACTIVITIES table. The ARCHIVE and ACTIVITIES table bothhave ACTIVITY as a primary key.D. The statement will fail since MERGE is not a supported operator.

    Answer: B

    Question: 70A developer wants to create an SQL procedure that will convert a temperature from degreesFahrenheit to degrees Centigrade. It is anticipated that the procedure will be invoked fromanother procedure using a CALL statement that looks like this: CALL proc.f_to_c(old_temp,new_temp); Which statement will successfully create an SQL procedure that accepts onetemperature value and returns another when called as shown?

    A. CREATE PROCEDURE proc.f_to_c(temp_f REAL, temp_c REAL) BEGINDECLARE temp_value REAL;SET temp_value = (temp_f - 32);SET temp_c = (5 * temp_value) / 9;END

    B. CREATE PROCEDURE proc.f_to_c(temp_f REAL, INOUT temp_c REAL) BEGINDECLARE temp_value REAL;SET temp_value = (temp_f - 32);SET temp_c = (5 * temp_value) / 9;END

    C. CREATE PROCEDURE proc.f_to_c(INOUT temp_f REAL, OUT temp_c REAL) BEGINDECLARE temp_value REAL;

    SET temp_value = (temp_f - 32);SET temp_c = (5 * temp_value) / 9;END

    D. CREATE PROCEDURE proc.f_to_c(IN temp_f, OUT temp_c) BEGINDECLARE temp_value REAL;SET temp_value = (temp_f - 32);SET temp_c = (5 * temp_value) / 9;END

  • 8/12/2019 000-735 Certification Part 1

    34/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 34 of 48

    Answer: B

    Question: 71Which two statements are true? (Choose two.)

    A. SQL procedures can contain static and/or dynamic SQL statements.B. Static or dynamic SQL execution is not associated with a package.C. The SQL procedure is always associated with a package that contains access paths of SQL

    statements in the procedure.D. It is necessary for an end-user to have object level privileges if that user has execute privileges

    on an associated package and the SQL procedure.E. SQL procedures can have COMMIT or ROLLBACK within atomic compound statements.

    Answer: A, C

    Question: 72

    A. ALTER PROCEDURE schema.procname HIDE PROCEDURE BODY;B. ALTER PROCEDURE schema.procname ENCRYPT PROCEDURE BODY;

    C. GET ROUTINE INTO sp.sar FROM PROCEDURE schema.procname ENCRYPT BODYDROP PROCEDURE schema.procname PUT ROUTINE FROM sp.sar

    D. GET ROUTINE INTO sp.sar FROM PROCEDURE schema.procname HIDE BODYDROP PROCEDURE schema.procnamePUT ROUTINE FROM sp.sar

    Answer: D

    Question: 73Click the Exhibit button. Referring to the exhibit, what is the number of rows that will be insertedin table T1 after calling the SQL procedure P1?

  • 8/12/2019 000-735 Certification Part 1

    35/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 35 of 48

    A. 9B. 10C. 19D. 20

    Answer: C

    Question: 74Given the procedure shown below:CREATE PROCEDURE proc ()

    BEGIN ATOMICINSERT INTO mytable (col1) VALUES ('a');INSERT INTO mytable (col1) VALUES ('b');SIGNAL SQLSTATE '70000';INSERT INTO mytable (col1) VALUES ('c');ENDHow many rows will be inserted in the table?

    A. 0

  • 8/12/2019 000-735 Certification Part 1

    36/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 36 of 48

    B. 1C. 2D. 3

    Answer: A

    Question: 75Click the Exhibit button. Referring to the exhibit, which two statements are correct? (Choose two.)

    A. If the EMPLOYEE_TEMP table exists, the execution order is 1,2,3.B. If the EMPLOYEE_TEMP table does not exist, the execution order is 1,4,3.C. If the EMPLOYEE_TEMP table exists, the execution order is 4,1,2,3.D. If the EMPLOYEE_TEMP table does not exist, the execution order is 4,1,3.E. If the messages table does not exist, the SQL procedure will still compile.

    Answer: A, B

    Question: 76Which two rules apply to the REFERENCING clause in a CREATE TRIGGER statement?(Choose two.)

    A. The OLD correlation-name and the OLD TABLE identifier can be used if the trigger event is anINSERT operation.

    B. The OLD correlation-name and the OLD TABLE identifier can be used if the trigger event is anUPDATE operation.

    C. The scope of each correlation-name and identifier used is the entire trigger definition.D. The OLD TABLE or NEW TABLE identifiers can be defined in a BEFORE trigger.E. A NEW correlation-name can be specified more than once for a trigger.

    Answer: B, C

    Question: 77

    Click the Exhibit button.A developer attempted to create a procedure to determine the oldest employee celebrating abirthday in a particular month by executing the SQL statement shown in the exhibit. Tests showthe procedure does not work as planned. What are two ways to make the procedure work asintended? (Choose two.)

  • 8/12/2019 000-735 Certification Part 1

    37/48

  • 8/12/2019 000-735 Certification Part 1

    38/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 38 of 48

    A. SELECT * FROM emp_birthmonth(8)B. VALUES emp_birthmonth(8)C. SELECT * FROM TABLE(emp_birthmonth(8))

    D. VALUES emp_birthmonth(INTEGER(8))

    Answer: C

    Question: 79Click the Exhibit button. The table and triggers in the exhibit have been created successfully,when the statements shown below are executed.INSERT INTO emp_hours VALUES('KAY', '9:00', '17:00');INSERT INTO emp_hours (emp_name, starting) VALUES('BILL', '9:00');What is the result?

    A. Table EMP_HOURS will contain these rows:

  • 8/12/2019 000-735 Certification Part 1

    39/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 39 of 48

    KAY 9:00:00 AM 5:00:00 PMBILL 9:00:00 AM 10:00:00 AM

    B. Table EMP_HOURS will contain this row:BILL 9:00:00 AM

    C. Table EMP_HOURS will contain these rows:KAY 9:00:00 AM 5:00:00 PMBILL 9:00:00 AM

    D. Table EMP_HOURS will contain this row:BILL 9:00:00 AM 17:00:00 PM

    Answer: A

    Question: 80What are two valid special registers? (Choose two.)

    A. CURRENT_CLIENT_ACCTB. CURRENT_SCHEMAC. CURRENT_PATHD. CURRENT_DATETIME

    E. CURRENT_PARTITION

    Answer: B, C

    Question: 81A trigger was created using the CREATE TRIGGER statement shown below.CREATE TRIGGER incrs_comm

    AFTER INSERT ON staffFOR EACH ROWMODE DB2SQLUPDATE staff SET comm = comm * 1.1Which statement is true about the INCRS_COMM trigger?

    A. The trigger will be executed if the STAFF table is populated by a load operation.B. The trigger will be executed before a row is inserted into the STAFF table.C. This trigger will be executed after a row is inserted into the STAFF table.D. This trigger will increase the comm value of a newly inserted row by 10 percent.

    Answer: C

    Question: 82Which two actions are supported by Data Studio in the SQL procedurelifecycle? (Choose two.)

    A. Create global temporary tables to use in the SQL procedure.B. Debug the SQL procedure.

    C. Deploy the SQL procedure.D. Use auto complete SQL statements.E. Create user-define types in the SQL procedure.

    Answer: B, C

    Question: 83What is the correct order for declarations in a compound statement defined by BEGIN and END?

    A. variable, cursor, handler, condition

  • 8/12/2019 000-735 Certification Part 1

    40/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 40 of 48

    B. variable, condition, cursor, handlerC. variable, condition, handler, cursorD. variable, cursor, condition, handler

    Answer: B

    Question: 84Which two statements describe a CASE statement? (Choose two.)

    A. CASE statements are used to enter into some logic based on a literal value.B. CASE statements are used to enter into some logic based on the value of an expression.C. CASE statements are used to return control to the beginning of an expression.D. CASE statements are used to enter into some condition and loop until the condition is met.E. CASE statements are used to iterate into some logic based on a literal value.

    Answer: A, B

    Question: 85Click the Exhibit button.

    A developer created a user-defined function using the statement shown in the exhibit. Now, thedeveloper would like to see the access plan used by the query in the function. What are the stepsneeded to do this from a CLP script file?

    A. 1. Set the CURRENT EXPLAIN MODE special register to EXPLAIN.2. Execute the CREATE FUNCTION statement.3. Set the CURRENT EXPLAIN MODE special register to NO.4. Run the db2exfmt utility.

    B. 1. Set the CURRENT EXPLAIN MODE special register to EXPLAIN.2. Execute the query portion of the CREATE FUNCTION statement (replacedept_employees.deptno with a hard-coded value).3. Set the CURRENT EXPLAIN MODE special register to NO.4. Run the db2exfmt utility.

    C. 1. Set the CURRENT EXPLSNAP special register to EXPLAIN.2. Execute the CREATE FUNCTION statement.3. Set the CURRENT EXPLSNAP special register to NO.4. Run the db2exfmt utility.

    D. 1. Set the CURRENT EXPLSNAP special register to EXPLAIN.2. Execute the query portion of the CREATE FUNCTION statement (replacedept_employees.deptno with a hard-coded value).

  • 8/12/2019 000-735 Certification Part 1

    41/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 41 of 48

    3. Set the CURRENT EXPLSNAP special register to NO.4. Run the db2exfmt utility.

    Answer: B

    Question: 86Click the Exhibit button. An SQL function was created using the statement shown in the exhibit.

    Assume this function is invoked by executing the SQL statement shown below:VALUES e_degree(SMALLINT(17))What will be returned?

    A. SQL0440N No authorized routine named "E_DEGREE" of type "FUNCTION" havingcompatible arguments was found. SQLSTATE=42884B. 1

    ------------BACHELOR1 record(s) selected.

    C. 1------------MASTER

    1 record(s) selected.D. 1------------UNKNOWN1 record(s) selected.

    Answer: D

  • 8/12/2019 000-735 Certification Part 1

    42/48

  • 8/12/2019 000-735 Certification Part 1

    43/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 43 of 48

    A. 1B. 2C. 3

    D. 4

    Answer: C

    Question: 90Which statement will create a scalar function named FCN1?

    A. CREATE SCALAR FUNCTION fcn1(v1 CHAR(3)) RETURNS CHAR(3)B. CREATE FUNCTION fcn1(v1 CHAR(3)) RETURNS ROW CONTAINING CHAR(3)C. CREATE SCALAR FUNCTION fcn1(v1 CHAR(3)) RETURNS ROW CONTAINING CHAR(3)D. CREATE FUNCTION fcn1(v1 CHAR(3)) RETURNS CHAR(3)

    Answer: D

    Question: 91Which SQL procedure returns two cursors to the application, by-passing any intermediary SQLprocedures?

    A. CREATE PROCEDURE read_employee_and_dept()DYNAMIC RESULT SETS 1BEGINDECLARE c_emp CURSOR WITH RETURN TO CALLER FORSELECT salary, bonus, comm

    FROM employeeWHERE job != 'PRES';DECLARE c_dept CURSOR WITH RETURN TO CALLER FORSELECT deptno, deptname, mgrno

    FROM department;END

    B. CREATE PROCEDURE read_employee_and_dept()DYNAMIC RESULT SETS 2BEGINDECLARE c_emp CURSOR WITH RETURN TO CLIENT FORSELECT salary, bonus, commFROM employeeWHERE job != 'PRES';

  • 8/12/2019 000-735 Certification Part 1

    44/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 44 of 48

    DECLARE c_dept CURSOR WITH RETURN TO CLIENT FORSELECT deptno, deptname, mgrnoFROM department;OPEN c_emp;OPEN c_dept;END

    C. CREATE PROCEDURE read_employee_and_dept()DYNAMIC RESULT SETS 2BEGINDECLARE c_emp CURSOR WITH RETURN TO CLIENT FORSELECT salary, bonus, commFROM employeeWHERE job != 'PRES';DECLARE c_dept CURSOR WITH RETURN TO CLIENT FORSELECT deptno, deptname, mgrnoFROM department;END

    D. CREATE PROCEDURE read_employee_and_dept()DYNAMIC RESULT SETS 2

    BEGINDECLARE c_emp CURSOR WITH RETURN TO CALLER FORSELECT salary, bonus, commFROM employeeWHERE job != 'PRES';DECLARE c_dept CURSOR WITH RETURN TO CALLER FORSELECT deptno, deptname, mgrnoFROM department;OPEN c_emp;OPEN c_dept;END

    Answer: B

    Question: 92Click the Exhibit button. Given the two functions in the exhibit, what is the correct command toinvoke the function which calculates the sum of two numbers from an SQL procedure?

    A. SELECT sum_of_2 FROM table1;B. SELECT sum(2,4,?);C. SET res_sum = sum(2,6);D. CALL sum(?,?,?);

  • 8/12/2019 000-735 Certification Part 1

    45/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 45 of 48

    Answer: C

    Question: 93Given the function shown below:CREATE FUNCTION fcn1(v1 VARCHAR(50))RETURNS VARCHAR(50)SPECIFIC fcn2RETURN LTRIM(RTRIM(v1))Which statement will invoke the function?

    A. SELECT * FROM VALUES LENGTH(fcn2(' one good day '))B. VALUES LENGTH( fcn1(' one good day '))C. CALL VALUES LENGTH(fcn1(' one good day '))D. CALL LENGTH(fcn2(' one good day '))

    Answer: B

    Question: 94Which statement will let you use the result set from the nested procedure CALLEE?

    A. ASSOCIATE RESULT SET LOCATOR( loc1) WITH PROCEDURE callee;B. BIND RESULT SET WITH PARAMETERS FOR PROCEDURE callee;C. INSERT RESULT SET FROM callee INTO CURSOR c1;D. SELECT * FROM callee;

    Answer: A

    Question: 95Click the Exhibit button.

    Which statement is true about the CASE statement shown in the exhibit?

    A. An employee with a rating of 1 receives a 10% salary increase.B. An employee with a rating of 3 receives no salary increase.C. An employee with a rating of 2 receives a 3% salary increase.D. All employees will receive at least a 5% salary increase.

    Answer: A

  • 8/12/2019 000-735 Certification Part 1

    46/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 46 of 48

    Question: 96Click the Exhibit button.The procedure TEST5 shown in the exhibit was invoked.How many rows will be added to the DEPT table?

    A. 1B. 2C. 3D. 4

    Answer: C

    Question: 97Click the Exhibit button.If the procedure shown in the exhibit is invoked, and the UPDATE statement returns anSQL0100W "No row was found for FETCH, UPDATE or DELETE; or the result of a query is anempty table.SQLSTATE '02000'", which two situations will be true? (Choose two)

  • 8/12/2019 000-735 Certification Part 1

    47/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    Page 47 of 48

    A. P_SQLSTATE will be set to '00000' and P_SQLCODE will be set to 0.B. P_SQLSTATE will be set to '02000' and P_SQLCODE will be set to 100.C. P_SQLSTATE will be set to '00000' and P_SQLCODE will be set to 100.D. The caller will receive an SQLCODE of 0.E. The caller will receive an SQLCODE of 100.

    Answer: A, E

    Question: 98Click the Exhibit button.Given the user-defined function shown in the exhibit, what will the function return if invoked usingthe statement shown below?SELECT check_id(1) FROM SYSIBM.SYSDUMMY1

  • 8/12/2019 000-735 Certification Part 1

    48/48

    Exam Name: DB2 9.5 SQL Procedure Developer

    Exam Type: IBM

    Exam Code: 000-735 Total Questions: 98

    A. Error: ID 1 is not validB. Application ErrorC. SQLSTATE 80000 will be returned, with the custom error message "Error: ID 1 is not valid"D. NULL

    Answer: D

    End of Document