0% found this document useful (2 votes)
4K views

Section 6

This document contains a quiz about user-defined records and indexing tables of records in PL/SQL. It consists of multiple choice and true/false questions testing knowledge of declaring record types and variables, as well as declaring and accessing elements of INDEX BY tables of records. An asterisk indicates the correct answer choice for each question.

Uploaded by

Sebassssd
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (2 votes)
4K views

Section 6

This document contains a quiz about user-defined records and indexing tables of records in PL/SQL. It consists of multiple choice and true/false questions testing knowledge of declaring record types and variables, as well as declaring and accessing elements of INDEX BY tables of records. An asterisk indicates the correct answer choice for each question.

Uploaded by

Sebassssd
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Test: Quiz: User-Defined Records Review your answers, feedback, and question scores below.

An asterisk (*) indicates a correct answer. Section 1 (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 can be used as an OUT parameter in a package procedure 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 can be defined as NOT NULL Correct 2. 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 Correct 3. Which of the following will successfully create a record type containing two fields, and a record variable of that type? TYPE person_type IS RECORD (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; (*) 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; Correct Test: Quiz: Indexing Tables of Records Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Mark for Review (1) Points Mark for Review (1) Points

Section 1 (Answer all questions in this section) 1. Which of these PL/SQL data structures can NOT store a collection? Mark for Review (1) Points

A PL/SQL record (*) An INDEX BY table of records An INDEX BY table indexed by PLS_INTEGER An INDEX BY table indexed by BINARY_INTEGER Correct 2. 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 TABLE OF departments%TYPE INDEX BY BINARY_INTEGER; DECLARE TYPE t_depttab IS TABLE OF departments%ROWTYPE 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 NUMBER; Correct 3. Which of the following methods can be used to reference elements of an INDEX BY table? (Choose three.) (Choose all correct answers) EXISTS (*) FIRST (*) COUNT (*) PREVIOUS DROP Correct 4. Which of these PL/SQL data structures could store a complete copy of the employees table, i.e., 20 complete table rows? A record Mark for Review (1) Points Mark for Review (1) Points Mark for Review (1) Points

An INDEX BY table of records (*) An INDEX BY table An explicit cursor based on SELECT * FROM employees; Incorrect. Refer to Section 6 Lesson 2. 5. What is the largest number of elements (i.e., records) that an INDEX BY table of records can contain? 100 4096 32767 Many millions of records because a BINARY_INTEGER or PLS_INTEGER can have a very large value (*) None of the above Correct 6. 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 Correct Mark for Review (1) Points Mark for Review (1) Points

You might also like