10 free sample questions from a bank of 74, with the correct answers and explanations. No signup required — start practising right now.
1View 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?
The output is x = y.
It produces an error.
The output is x != y.
The output is Can't tell if x and y are equal or not.
Answer: D
2The STRING_TAB table has the following structure: View the Exhibit and examine the code. What is the outcome on execution?
It displays Output buffer not long enough. This is my test string.-.
It displays only Output buffer not long enough, and exits the anonymous block.
It displays only This is my test string. - Because EXCEPTION should have been defined in the anonymous block to get the error message.
It does not display any of the MEMS_PUTPUT messages and gives an error because a transaction control statement cannot be used in the exception section
Answer: A
3View the Exhibit and examine the structure of the AUDIR_CUST table.
Exhibit Missing -
CUST_ID and CUST_LIMIT are existing columns in the CUSTOMER table.
Examine the following trigger code: Which statement is true about the above trigger?
It gives an error on compilation because it should be a statement-level trigger.
It compiles and fires successfully when the credit limit is updated in the customer table.
It gives an error on compilation because of the commit command in the trigger code.
It compiles successfully, but gives an error when the credit limit is updated in the CUSTOMER table because the PRAGMA AUTONOMOUS_TRANSACTION
Answer: D
4Which three statements are true about anonymous blocks and subprograms? (Choose three.)
Only subprograms can be parameterized.
Only subprograms are persistent database objects.
Both anonymous blocks and subprograms can be parameterized.
Both anonymous blocks and subprograms are persistent database objects.
Only subprograms can return values that persist after the execution of the subprogram.
Both anonymous blocks and subprograms can return values that persist in SQL*Plus variables after their execution.
Answer: B, C, F
5View the Exhibit and examine the partial data in the PRODUCTS table.
PROD_ID is the primary key. Examine the following code: What is the outcome on execution of the above code?
It executes successfully.
It gives an error because the DECODE function can be used only in a SQL statement.
It gives an error because the SUBSTR and INSTR functions can be used only in a SQL statement.
It gives an error because both the MAX and DECODE functions can be used only in a SQL statement.
Answer: A
6View Exhibit 1 and examine the structure of the EMP table. View Exhibit 2 and examine the PL/SQL block of code. What is the outcome?
It gives an error because the return type is not valid.
It gives an error because the record type is not defined within the function.
It gives an error because the function call in DBMS_OUTPUT. PUT__LINE is not valid
It executes successfully and displays the names and salaries of all employees who earn the highest salary.
It executes successfully but does not display the names and salaries of all employees who earn the highest salary.
Answer: E
7View the Exhibit and examine the blocks of code that you plan to execute. Which statement is true about the blocks of code?
All the blocks execute successfully and the anonymous block displays cnt: 45 cnt: 45
All the blocks execute successfully and the anonymous block displays cnt: 0 cnt: 1
The anonymous block gives an error because the function invocation in line 2 is not valid.
The procedure creation gives an error because the function invocation in line 1 is not valid.
Answer: A
8View 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.)
Bind
Parse
Fetch
Execute
Answer: C
9View the Exhibit and examine the structure of the AUDIR_CUST table. CUST_ID and CUST_LIMIT are existing columns in the CUSTOMER table.
Examine the following trigger code: Which statement is true about the above trigger?
It gives an error on compilation because it should be a statement-level trigger.
It compiles and fires successfully when the credit limit is updated in the customer table.
It gives an error on compilation because of the commit command in the trigger code.
It compiles successfully, but gives an error when the credit limit is updated in the CUSTOMER table because the PRAGMA AUTONOMOUS_TRANSACTION
Answer: D
10Identify two situations where the DBMS_SQL package should be used. (Choose two.)
The SELECT list is not known until run time.
The dynamic SQL statement retrieves rows into records.
You do not know how many columns a select statement will return, or what their data types will.
You must use the % found SQL cursor attribute after issuing a dynamic SQL statement that is an insert or update statement.