Halaman

Monday, August 19, 2019

Answer Section 6 Quiz Database Programming with PL/SQL 2019 Learner - English


Section 6


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? 
                                                                               
                                               
                DECLARE
    TYPE t_depttab IS INDEX BY TABLE OF departments%ROWTYPE
    INDEX BY BINARY_INTEGER;

  
                                             
                DECLARE
    TYPE t_depttab IS TABLE OF departments%ROWTYPE
    INDEXED BY NUMBER;

                                               
                DECLARE
    TYPE t_depttab IS TABLE OF departments%ROWTYPE
    INDEX BY BINARY_INTEGER;
(*)


                                               
                DECLARE
    TYPE t_depttab IS TABLE OF departments%TYPE
    INDEX BY BINARY_INTEGER;

                                                                               
                                                               
What is the largest number of elements (i.e., records) that an INDEX BY table of records can contain?            
                                                                               
                                               
                Many millions of records because a BINARY_INTEGER or PLS_INTEGER can have a very large value (*)

                                               
                32767

                                               
                100

                                               
                4096

                                               
                None of these.

                                                                               
                                                               
An INDEX BY TABLE must have a primary key.    
                                                                               
                                               
                True (*)

                                               
                False

                                                                               
                                                               
In an INDEX BY table of records the record can be _______________________.           
                                                                               
                                               
                %ROWTYPE

                                               
                Either one. (*)

                                               
                a user-defined record

                                                                               
An INDEX BY TABLE type can only have one data field.    
                                                                               
                                               
                True (*)

                                               
                False

Identify the valid collection types:      
                                                                               
                                               
                INDEX BY TABLE OF RECORDS (*)

                                               
                INDEX BY TABLE OF ROWS

                                               
                INDEX BY TABLE (*)

                                               
                INDEX BY VIEW

                                                                               
                                                               
To declare an INDEX BY table, we must first declare a type and then declare a collection variable of that type. True or False? 
                                                                               
                                               
                True (*)

                                               
                False

                                                                               
                                                               
Which of these PL/SQL data structures can NOT store a collection?      
                                                                               
                                               
                An INDEX BY table indexed by PLS_INTEGER

                                               
                An INDEX BY table indexed by BINARY_INTEGER

                                               
                An INDEX BY table of records

                                               
                A PL/SQL record (*)

                                                                               
                                                               
Which of the following methods can be used to reference elements of an INDEX BY table? (Choose three.)   

                PREVIOUS

                                               
                EXISTS (*)

                                               
                FIRST (*)

                                               
                DROP

                                               
                COUNT (*)

                                                                               
                                                               
 An INDEX BY TABLE primary key cannot be negative.      
                                                                               
                                               
                True

                                               
                False (*)


Consider the following code:
DECLARE
 TYPE dept_info_type IS RECORD
  (department_id departments.department_id%TYPE,
  department_name departments.department_name%TYPE);
 TYPE emp_dept_type IS RECORD
  (first_name employees.first_name%TYPE,
  last_name employees.last_name%TYPE),
  dept_info dept_info_type);

 v_dept_info_rec dept_info_type;
 v_emp_dept_rec emp_dept_type;

How many fields can be addressed in v_dept_info_rec?
                                                            
                                               
                one

                                               
                four

                                               
                two (*)

                                               
                three

                                                                               
The following code declares a PL/SQL record with the same structure as a row of the departments table. True or False?
DECLARE
    v_dept_rec departments%ROWTYPE;
...
                                                                  
                                               
                True (*)

                                               
                False

                                                                               
                                                                               
Which of the following statements about user-defined PL/SQL records is NOT true?     
                                                                               
                                               
                It can be a component of another PL/SQL record.

                                               
                It must contain one or more components, but all the components must have scalar datatypes. (*)

                                               
                It is not the same as a row in a database table.

                                               
                It can be used as an OUT parameter in a package procedure.

                                               
                It can be defined as NOT NULL.

                                                                               
                                                               
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.
                                                                               
                                               
                True (*)

                                               
                False

                                                                               
                                                               
Which of the following will successfully create a record type containing two fields, and a record variable of that type? 
                                                                               
                                               
                TYPE person_type IS (l_name VARCHAR2(20),
    gender CHAR(1));
person_rec person_type;

                                               
                TYPE person_type IS RECORD
    (l_name VARCHAR2(20),
    gender CHAR(1));
person_rec TYPE 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 person_type;
(*)


No comments:

Post a Comment

Final Exam Java Programming 2019 Learner - English

Final Exam