Académique Documents
Professionnel Documents
Culture Documents
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 6 Quiz
(Answer all questions in this section)
1.Which of the following statements about user-defined PL/SQL records is NOT true?
Mark for Review
(1) Points
It is not the same as a row in a database table.
It must contain one or more components, but all the components must have scalar
datatypes. (*)
It can be used as an OUT parameter in a package procedure.
Correct
2.You can store a whole record in a single variable using %ROWTYPE or by creating your
own record structure as a type and then declaring a variable of that type. Mark for Review
(1) Points
True (*)
False
Correct
3.The following code declares a PL/SQL record with the same structure as a row of the
departments table. True or False? Mark for Review
(1) Points
DECLARE
v_dept_rec departments%ROWTYPE;
...
True (*)
False
Correct
4.Which of the following will successfully create a record type containing two fields, and a
record variable of that type? Mark for Review
(1) Points
TYPE person_type IS RECORD
(l_name VARCHAR2(20),
gender CHAR(1));
person_rec person_type;
(*)
TYPE person_type IS (l_name VARCHAR2(20),
gender CHAR(1));
person_rec person_type;
TYPE person_type IS (l_name VARCHAR2(20),
gender CHAR(1));
person_rec TYPE person_type;
TYPE person_type IS RECORD
(l_name VARCHAR2(20),
gender CHAR(1));
person_rec TYPE person_type;
Correct
False
Correct
Section 6 Quiz
(Answer all questions in this section)
6. Which of these PL/SQL data structures could store a complete copy of the employees
table, i.e., 20 complete table rows? Mark for Review
(1) Points
An explicit cursor based on SELECT * FROM employees;
A record
An INDEX BY table
Correct
DROP
EXISTS (*)
FIRST (*)
PREVIOUS
Correct
%ROWTYPE (*)
Either one.
False
Correct
10.An INDEX BY TABLE type can only have one data field.
Mark for Review
(1) Points
True (*)
False
Correct
Section 6 Quiz
(Answer all questions in this section)
11.What is the largest number of elements (i.e., records) that an INDEX BY table of records
can contain? Mark for Review
(1) Points
None of these.
4096
32767
Correct
12.Which of the following successfully declares an INDEX BY table of records which could
be used to store copies of complete rows from the departments table? Mark for Review
(1) Points
DECLARE
TYPE t_depttab IS TABLE OF departments%ROWTYPE
INDEXED BY NUMBER;
DECLARE
TYPE t_depttab IS TABLE OF departments%TYPE
INDEX BY BINARY_INTEGER;
DECLARE
TYPE t_depttab IS INDEX BY TABLE OF departments%ROWTYPE
INDEX BY BINARY_INTEGER;
DECLARE
TYPE t_depttab IS TABLE OF departments%ROWTYPE
INDEX BY BINARY_INTEGER;
(*)
Correct
False (*)
Correct
INDEX BY VIEW
Correct
Correct