Q1. 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
Q2. You want to create a trigger that fires whenever rows are deleted from the customer table and that displays the number of rows remaining in the table.
Which two statements are correct about the trigger to be created for the above requirement? (Choose two.)
A. It should be an after trigger.
B. It should be a before trigger.
C. It should be a row-level trigger.
D. It should be a statement-level trigger.
E. It can be a before or an after trigger.
Answer: A,C
Q3. View the exhibit and examine the structure of the EMPLOYEES table
The salary of EMPLOYEE_ID 195 is 2800.
You execute the following code
What is the outcome?
A. It gives an error because only the innermost block is labeled.
B. It gives an error because the same variable name cannot be used across all the nested blocks.
C. It executes successfully and displays the resultant values in the following sequence-1000, 2800 50000, 2800.
D. It executes successfully and displays the resultant values in the following sequence: 1000, 2800, 50000, 1000.
Answer: C
Q4. Which statements are true about PL/SQL procedures? (Choose all that apply.)
A. Users with definer's rights who are granted access to a procedure that updates a table must be granted access to the table itself.
B. Reuse of parsed PL/SQL code that becomes available in the shared SQL area of the server avoids the parsing overhead of SQL statements at run time.
C. Depending on the number of calls, multiple copies of the procedure are loaded into memory for execution by multiple users to speed up performance.
D. A PL/SQL procedure executing on the Oracle database can call an external procedure or function that is written in a different programming language, such as C or Java.
Answer: B,D
Q5. View Exhibit 1 and examine the structure of the EMP table.
View Exhlbit2 and examine the code of the packages that you have created.
You issue the following command:
SQL> DROP PACKAGE manage_emp;
What is the outcome?
A. It drops both the MANAGE_EMP AND EMP__DET packages because of the cascading effect.
B. It drops the MANAGE_EMP package and invalidates only the body for the EMP_DET package.
C. It returns an error and does not drop the MAMAGE_EMP package because of the cascading effect.
D. It drops the MANAGE_EMP package and invalidates both the specification and body for the EMP_DET package.
Answer: B
Q6. 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
Q7. View the Exhibit to examine the PL/SQL code.
The record for the employee with employee__id 100 in the employees table is as follows;
Identify the correct output for the code.
A. King 17-JUN-87 1500
B. King 17-JUN-87 24000
C. King current sysdate 1500
D. King current sysdate 24000
Answer: A
Q8. View the Exhibit and examine the structure of the employees table.
Examine the following block of code:
What is the outcome when the above code is executed?
A. It executes successfully.
B. It gives an error because decode cannot be used in a PL/SQL block.
C. It gives an error because the AVG function cannot be used in a PL/SQL block
D. It gives an error because the MONTHS_BETWEEN function cannot be used in a PL/SQL block.
E. It gives an error because both the AVG and decode functions cannot be used in a PL/SQL block.
Answer: A
Q9. View Exhibit1 and examine the structure of the employees table.
View Exhibit2 and examine the code.
What is the outcome when the code is executed?
A. Both blocks compile and execute successfully when called.
B. Both blocks compile successfully but the CALC_SAL procedure gives an error on execution.
C. The CALC_SAL procedure gives an error on compilation because the amt variable should be declared in the RAISE_SALARY procedure.
D. The CALC_SAL procedure gives an error on compilation because the RAISE_SALARY procedure cannot call the stand-alone increase function.
Answer: A
Q10. Examine the following PL/SQL code;
The execution of the code produces errors. Identify the error in the code.
A. The open cursor is missing
B. The fetch clause is missing
C. The exit when condition is missing
D. The EMP_NAME and EMP_JOB variables cannot be used in the for clause of the cursor FOR statement.
Answer: B