Mid Term Exam Semester 1 Part 1
Mid Term Exam Semester 1 Part 1
This is Part
I of the Mid Term Exam for Semester 1.
Section 1
1. The P in PL/SQL stands for: Mark for Review
(1) Points
Processing
Procedural (*)
Primary
Proprietary
Correct Correct
PL/SQL and SQL can be used with many types of databases, including Oracl
e.
PL/SQL allows basic program logic and control flow to be combined with S
QL statements. (*)
Correct Correct
declarative
nondeclarative
procedural (*)
low level
Correct Correct
True (*)
False
Correct Correct
PL/SQL is easier to learn and does not require an Oracle database or too
l
Correct Correct
Correct Correct
procedure
subroutine
function
anonymous (*)
Correct Correct
Correct Correct
2,1,4,3
3,4,2,1 (*)
3,2,4,1
4,3,2,1
Correct Correct
Application Builder
Utilities
Object Browser
Correct Correct
Section 1
11. Which keywords must be included in every PL/SQL block? (
Choose two.) Mark for Review
(1) Points
(Choose all correct answers)
DECLARE
END; (*)
EXCEPTION
BEGIN (*)
DBMS_OUTPUT.PUT_LINE
Correct Correct
Executable
Exception
Declarative (*)
Definition
Correct Correct
True (*)
False
Correct Correct
Section 2
14. Evaluate the following declaration. Determine whether or
not it is legal.
DECLARE
maxsalary NUMBER(7) = 5000;
Mark for Review
(1) Points
Correct.
Correct Correct
To comment code.
Correct Correct
True (*)
False
Correct Correct
v_last_name := Chandra;
v_blackout_date := '31-DEC-2006'; (*)
Correct Correct
Correct.
Correct Correct
If Oracle changes the conversion rules in the future, your code may not
work any more (*)
'300'
300 (*)
NULL
TO_CHAR(sysdate)
TO_DATE(sysdate)
True
False (*)
Correct Correct
Explicit (*)
Implicit
TO_CHAR
Correct Correct
Correct Correct
Character functions
Operators
Correct Correct
81
49
14 (*)
18
Correct Correct
27. 1. Null
2. False
3. True
4. 0
Which of the above can be assigned to a Boolean variable?
Mark for Review
(1) Points
2 and 3
2, 3 and 4
1, 2 and 3 (*)
1, 2, 3 and 4
Correct Correct
If the SALARY column is ALTERed later, the PL/SQL code need not be chang
ed. (*)
29. If you are using the %TYPE attribute, you can avoid hard
coding the: Mark for Review
(1) Points
Table name
Column name
Constraint
Correct Correct
Scalar
Composite (*)
LOB
Correct Correct
Section 2
31. A movie is an example of which category of data type?
Mark for Review
(1) Points
Scalar
Composite
Reference
LOB (*)
Correct Correct
True (*)
False
Correct Correct
identifiers
variables
symbols (*)
Correct Correct
They are optional but can make a PL/SQL block execute faster
True
False (*)
Correct Correct
True (*)
False
Correct Correct
37. 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 Correct
Susan
Chang (*)
ChangChang
SusanChang
Both blocks fail and an error message is displayed by the calling enviro
nment
12
20
VarB
Incorrect Incorrect. Refer to Section 2.
Section 3
41. A PL/SQL block includes the following statement:
SELECT last_name INTO v_last_name
FROM employees
WHERE employee_id=100;
What is the value of SQL%ISOPEN immediately after the SELECT statement is execut
ed?
Mark for Review
(1) Points
True
False (*)
Null
A NULL is displayed.
An exception is raised because the block does not contain a COMMIT state
ment.
Correct Correct
43. Which is the correct way to erase one row from a table?
Mark for Review
(1) Points
REMOVE employee_id=100
FROM employees;
TRUNCATE employees
WHERE employee_id=100;
Correct Correct
45. Which rows will be deleted from the EMPLOYEES table when
the following code is executed?
DECLARE
salary employees.salary%TYPE := 12000;
BEGIN
DELETE FROM employees
WHERE salary > salary;
END;
Mark for Review
(1) Points
No rows. (*)
DESCRIBE employees;
UPDATE employees
SET last_name='Smith';
(*)
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 Correct
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 Correct
Only one
Correct Correct
You have nothing new; the last ROLLBACK undid the INSERTs.
You have the rows added twice; there are four new rows.