10 free sample questions from a bank of 88, with the correct answers and explanations. No signup required — start practising right now.
1Which two PL/SQL elements can be deprecated using the DEPRECATE pragma? (Choose two.)
PACKAGES
VARIABLES
ANONYMOUS BLOCK
TRIGGER BODY
DATABASE LINKS
Answer:
2Which three are valid PL/SQL variable names? (Choose three.)
printer_name#
1to7number
yesterday's_date
leap$year
Number_of_days_between_March_and_April
#printer_name
v_fname
Answer:
3Which two are true about collections and RECORD types? (Choose two.)
A variable of RECORD type can contain fields of another RECORD type or any collection type.
Only associative arrays and nested tables can have elements of RECORD type.
All collections and RECORD types can be defined in PL/SQL blocks, packages, or at the schema level.
Collections and RECORD types are always dense.
All collections and RECORD types can be stored in table columns.
VARRAYS, nested tables and each field in %ROWTYPE type variables have a default value of null.
Answer:
4Examine this table in the SH schema: User SH executes this code: The program must terminate with a user-defined message and no rows displayed if more than one product's price is 1000.
With which option must “---placeholder” be replaced?
Answer:
5Examine this row of data from the EMPLOYEES table: Now, examine this block of code which executes successfully: What is the value of v_commission?
5000
15000
2500
10000
Answer: C
6Examine this table in the SH schema: Now, examine this code: Which two changes are required to ensure that PDT_REPORT executes successfully? (Choose two.)
In line 1, change IN OUT mode to IN mode.
In line 2, change IN OUT mode to IN mode.
In line 3, replace CUR_PRICE with P_PDT_PRICE in the query condition.
In line 1, add the default parameter DEFAULT 2000.
In line 6, replace P_PDT_PRICE parameter name with CUR_PRICE.
In line 2, add the default parameter DEFAULT 2000.
Answer:
7User ORA41 executes these statements successfully: Now, examine this statement which is executed successfully by user ORA61 after a successful login:
EXECUTE ora41.update_emp_proc(100,25000);
Which two are true? (Choose two.)
The salary will be changed for employee 100 in the EMPLOYEES table owned by ORA41.
No update happens even though the procedure executes successfully.
The salary will be changed for employee 100 in the EMPLOYEES table owned by ORA61.
The UPDATE privilege on ORA41.EMPLOYEES is not inherited by ORA61 through the procedure.
ORA61 will have been granted the UPDATE privilege explicitly on ORA41.EMPLOYEES before executing the statement.
Answer:
8Which two are true about exception handling? (Choose two.)
Internally defined exceptions can be handled only by the OTHERS exception handler.
All declared exceptions are raised implicitly by the runtime system.
User-defined exceptions can be defined in the declarative part of any PL/SQL anonymous block, subprogram, or package.
Only predefined exceptions and user-defined exceptions can have a user-declared name associated with them.
Predefined exceptions are globally declared in the standard package.
Answer:
9Examine these statements: Which is true?
It will result in a compilation error for protected_proc because calling_proc does not exist.
It will result in a compilation error for protected_proc because calling_proc must be prefixed with the schema name.
It will result in a successful compilation because objects referenced in an ACCESSIBLE BY clause are not checked at compile time.
With adequate privileges, PROTECTED_PROC procedure can be called by other programs apart from CALLING_PROC.
Answer: C
10Examine the EMPLOYEES table structure: Now, examine this code: Which statement is true about the result of executing this block?
It will execute successfully provided the salary of EMP_ID 200 does not exceed the value 99999.
It will return an error at line 2.
It will return an error at line 3.
It will return an error at line 8.
It will execute successfully by rounding up the salary of EMP_ID 200 to the appropriate value.