Plsqlparti 1
Plsqlparti 1
Plsqlparti 1
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
To comment code.
Correct
Correct.
Correct
True (*)
False
Correct
True (*)
False
Correct
v_last_name := Chandra;
Correct
Page 1 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
6. When nested blocks are used, which blocks can or must be labeled?
Mark for Review
(1) Points
The inner block must be labeled, the outer block can be labeled.
Correct
7. What will be displayed when the following code is executed?
DECLARE
varA NUMBER := 12;
BEGIN
DECLARE
varB NUMBER := 8;
BEGIN
varA := varA + varB;
END;
DBMS_OUTPUT.PUT_LINE(varB);
END;
12
20
VarB
Correct
My
My name (*)
My name is
My name is Zeynep
Correct
Correct
True (*)
False
Correct
Page 2 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
11. Which of these are PL/SQL data types? (Choose three.) Mark for
Review
(1) Points
Identifier
Delimiter
Composite (*)
LOB (*)
Correct
True (*)
False
Correct
Scalar
Composite
Reference
LOB (*)
Correct
SELECT *
INTO v_holdit
FROM employees;
SELECT last_name
INTO v_holdit
FROM employees;
SELECT last_name
INTO v_holdit
FROM employees
WHERE employee_id=100;
(*)
SELECT salary
INTO v_holdit
FROM employees
WHERE employee_id=100;
Correct
DESCRIBE employees;
UPDATE employees
SET last_name='Smith';
(*)
Correct
Page 3 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
Mid Term Exam Semester 1 - Part 1
SELECT salary
INTO v_salary
FROM employees
WHERE employee_id=100;
(*)
SELECT v_salary
INTO salary
FROM employees
WHERE employee_id=100;
SELECT salary
FROM employees
INTO v_salary;
SELECT salary
FROM employees
WHERE employee_id=100
INTO v_salary;
Correct
17. Which of the following is NOT a good guideline for retrieving data
in PL/SQL? Mark for Review
(1) Points
Correct
Correct
19. Assume there are 5 employees in Department 10. What happens when
the following statement is executed?
UPDATE employees
SET salary=salary*1.1;
An error message is displayed because you must use the INTO clause to
hold the new salary.
Correct
True
False (*)
Null
Error. That attribute does not apply for implicit cursors.
Correct
Page 4 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
21. Which SQL statement can NOT use an implicit cursor? Mark for
Review
(1) Points
A DELETE statement
An UPDATE statement
DECLARE (*)
BEGIN
EXCEPTION (*)
END;
Correct
23. Every PL/SQL anonymous block must start with the keyword DECLARE.
True or False? Mark for Review
(1) Points
True
False (*)
Correct
procedure
subroutine
function
anonymous (*)
Correct
25. Errors are handled in the Exception part of the PL/SQL block. True
or False? Mark for Review
(1) Points
True (*)
False
Correct
Page 5 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
Mid Term Exam Semester 1 - Part 1
26. Which PL/SQL block type must return a value? Mark for Review
(1) Points
Anonymous
Function (*)
Procedure
Correct
DECLARE
END; (*)
EXCEPTION
BEGIN (*)
DBMS_OUTPUT.PUT_LINE
Correct
Correct
29. Which of the following tools can NOT be used to develop and test
PL/SQL code? Mark for Review
(1) Points
Oracle Jdeveloper
Oracle iSQL*Plus
Correct
v_count PLS_INTEGER:=0;
college_name VARCHAR2(20):='Harvard';
Correct
Page 6 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
31. You need to declare a variable to hold a value which has been read
from the SALARY column of the EMPLOYEES table. Which of the following is
an advantage of declaring the variable as: employees.salary%TYPE ? Mark
for Review
(1) Points
If the SALARY column is ALTERed later, the PL/SQL code need not be
changed. (*)
Correct
32. If you are using the %TYPE attribute, you can avoid hard coding
the: Mark for Review
(1) Points
Table name
Column name
Constraint
Correct
Only one
Correct
'300'
300 (*)
NULL
Correct
Page 7 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
v_string = 'Hello';
v_string := Hello;
v_date := 28-DEC-06;
Correct
37. When you use a function to convert data types in a PL/SQL program,
it is called ______ conversion. Mark for Review
(1) Points
Explicit (*)
Implicit
TO_CHAR
Correct
38. If today's date is 14th June 2007, which statement will correctly
convert today's date to the value: June 14, 2007 ? Mark for Review
(1) Points
TO_CHAR(sysdate)
TO_DATE(sysdate)
Correct
39. Single row character functions are valid SQL functions in PL/SQL.
True or False? Mark for Review
(1) Points
True (*)
False
Correct
Correct
Page 8 of 10
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
41. Examine the following code. What is the final value of V_MYBOOL ?
DECLARE
v_mynumber NUMBER;
v_mybool BOOLEAN ;
BEGIN
v_mynumber := 6;
v_mybool := (v_mynumber BETWEEN 10 AND 20);
v_mybool := NOT (v_mybool);
END;
True (*)
False
Correct
True
False (*)
Correct
43. Examine the following code. What is the final value of V_MYVAR ?
DECLARE
v_myvar NUMBER;
BEGIN
v_myvar := 1 + 2 * 3;
v_myvar := v_myvar * 2;
END;
81
49
14 (*)
18
Correct
44. TO_NUMBER, TO_CHAR, and TO_DATE are all examples of: Mark for
Review
(1) Points
Character functions
Operators
Correct
True
False (*)
Correct
Page 9 of 10
Test: Mid Term Exam Semester 1 - Part I
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
46. PL/SQL extends SQL by including all of the following except: Mark
for Review
(1) Points
variables
conditional statements
constants
Correct
Processing
Procedural (*)
Primary
Proprietary
Correct
True
False (*)
Correct
49. Delimiters are _____ that have special meaning to the Oracle
database. Mark for Review
(1) Points
identifiers
variables
symbols (*)
Correct
50. Which of the following are valid identifiers? (Choose two.) Mark
for Review
(1) Points
yesterday (*)
yesterday's date
number_of_students_in_the_class
v$testresult (*)
#students
Correct
Page 10 of 10