oracle 1z0-144 online test

Oracle Database 11g: Program with PL/SQL

What students need to know about the 1z0-144 exam

  • Total 115 Questions & Answers

Question 1

Which two statements are true about the continue statement? (Choose two.)

  • A. The PL/SQL block execution terminates immediately.
  • B. The CONTINUE statement cannot appear outside a loop.
  • C. The loop completes immediately and control passes to the statement after end loop.
  • D. The statements after the continue statement in the iteration are executed before terminating the LOOP.
  • E. The current iteration of the loop completes immediately and control passes to the next iteration of the loop.
Answer:

B E

Discussions

Question 2

View the Exhibit to examine the PL/SQL code:

DECLARE
x NUMBER := 5; y NUMBER := NULL;
BEGIN
IF x != y THEN yields NULL, not TRUE
DBMS_OUTPUT.PUT_LINE(x != y); not run
ELSIF x = y THEN also yields NULL
DBMS_OUTPUT.PUT_LINE(x = y);
ELSE
DBMS_OUTPUT.PUT_LINE
(Cant tell if x and y are equal or not.);
END IF;
END;
/
SREVROUPUT is on for the session. Which statement is true about the output of the PL/SQL block?

  • A. The output is x = y.
  • B. It produces an error.
  • C. The output is x != y.
  • D. The output is Can't tell if x and y are equal or not.
Answer:

D

Discussions

Question 3

In which of the following scenarios would you recommend using PL/SQL records?

  • A. when you want to retrieve an entire row from a table and perform calculations
  • B. when you know the number of elements in advance and the elements are usually accessed sequentially
  • C. when you want to create a separate lookup table with multiple entries for each row of the main table, and access it through join queries
  • D. when you want to create a relatively small lookup table, where the collection can be constructed in memory each time a subprogram is invoked
Answer:

A

Discussions

Question 4

View the Exhibit and examine the structure of the EMP table.

You want to create two procedures using the overloading feature to search for employee details based on either the
employee name or employee number. Which two rules should you apply to ensure that the overloading feature is used
successfully? (Choose two.)

  • A. The procedures can be either stand-alone or packaged.
  • B. The procedures should be created only as packaged subprograms.
  • C. The procedures should be created only as stand-alone subprograms.
  • D. Each subprogram's formal parameters should differ in both name and data type.
  • E. The formal parameters of each subprogram should differ in data type but can use the same names.
Answer:

B E

Discussions

Question 5

Which two statements are true about anonymous blocks and named subprograms? (Choose two)

  • A. Subprograms are by default executed with definer's rights.
  • B. The declare section is optional for both anonymous blocks and subprograms.
  • C. Both anonymous blocks and subprograms execute by default with invoker's rights.
  • D. The declare section is mandatory for anonymous blocks and optional for subprograms.
Answer:

A B

Discussions

Question 6

View the Exhibit to examine the PL/SQL code.

SERVEROUTPUT is on for the session.
Which statement is true about the execution of the code?

  • A. The execution fails because of the misplaced else clause.
  • B. The execution is successful even if there is no employee with EMPLOYEE_ID 115.
  • C. The execution fails and throws exceptions if no employee with EMPLOYEE_ID 115 is found.
  • D. The execution is successful, but it displays an incorrect output if no employee with EMPLOYEE_ID 115 is found.
Answer:

C

Discussions

Question 7

Which two statements are true about the %ROWTYPE attribute? (Choose two.)

  • A. It is used to declare a record that can hold multiple rows of a table.
  • B. The attributes of fields in the record with the %ROWTYPE attribute can be modified manually.
  • C. The attributes of fields in the record take their names and data types from the columns of the table, view, cursor, or cursor variable.
  • D. It ensures that the data types of the variables that are declared with the %ROWTYPE attribute change dynamically when the underlying table is altered.
Answer:

C D

Discussions

Question 8

View the Exhibit and examine the structure of the EMP table.

Examine the following block of code:

Which stages are performed when the above block is executed? (Choose all that apply.)

  • A. Bind
  • B. Parse
  • C. Fetch
  • D. Execute
Answer:

C

Explanation:
Reference
https://www.ibm.com/support/knowledgecenter/en/SS6NHC/com.ibm.swg.im.dashdb.apdv.plsql.doc/doc/c0053844.html

Discussions

Question 9

View Exhibit 1 and examine the structure of the EMP and DEPT tables.

View Exhibit 2 and examine the trigger code that is defined on the DEPT table to enforce the update and delete restrict
referential actions on the primary key of the DEPT table.

What is the outcome on compilation?

  • A. It compiles and executes successfully.
  • B. It gives an error on compilation because it is not a row-level trigger.
  • C. It gives an error on compilation because the exception section is used in the trigger.
  • D. It compiles successfully but gives an error on execution because it is not a row-level trigger.
Answer:

B

Discussions

Question 10

View the Exhibit and examine the structure of the employees table.

Execute the following block of code:

What is the outcome?

  • A. It gives an error because group functions cannot be used in anonymous blocks.
  • B. It executes successfully and correctly gives the result of the sum of salaries in department 60.
  • C. It executes successfully and incorrectly gives the result of the sum of salaries in department 60.
  • D. It gives an error because the variable name and column name are the same in the where clause of the select statement.
Answer:

C

Discussions
To page 2