PL/SQL Chapter 3: Handling Data In PL/SQL Complete 2022
The INTO clause follows the SELECT clause and indicates which variables are to hold the values that are retrieved from the database. TRUE A disadvantage of using the %TYPE attribute is that there is a slight performance hit in that the database server must look up the data type from the data dictionary. TRUE A collection is a data type that can store multiple values of different data types as one unit. FALSE A composite data type is a variable that can store and handle multiple values of the same data type as one unit. FALSE A scalar variable can hold multiple values whereas a composite variable can hold only a single value. FALSE A variable declared with a record type can hold one row of data consisting of a number of column values. TRUE Declaring a composite variable is different from declaring a scalar variable in that you must create your own data types. TRUE When placing data into a table of records variable, you must indicate the field that will hold the value but you need not indicate the row. FALSE Declaring a table of records variable in a package specification allows it to persist for a user session. TRUE Anchored data types are similar to arrays used on other languages. FALSE It is possible to perform SQL commands on an associative array. FALSE One major advantage of using collections as part of the physical database is being able to retrieve multiple values with a query of a single column. TRUE One of the main differences between a nested table and a VARRAY is that a nested table has a set size upon creation. FALSE The syntax of the following code fragment is correct. BEGIN If lv_rows_num = 0 GOTO insert_row; End If; ... FALSE The GOTO statement interrupts the flow of execution of a program. TRUE PL/SQL blocks use assignment variables to assign values to variables. _________________________ FALSE statements The REF attribute tells the system to look up the data type of a database column and use it for the declared variable. _________________________ FALSE %TYPE A(n) composite data type is one that can store and handle multiple values of different data types as one unit. _________________________ TRUE A(n) table of records can handle more than one row of data. _________________________ TRUE A(n) index table is an ordered group of elements that allows the handling of multiple values of the same data type as a single unit. _________________________ FALSE collection Declaring an associative array data type is quite similar to declaring a(n) table of records data type. _________________________ TRUE The associative array attribute EXISTS returns the total number of values in the table. _________________________ FALSE COUNT The UPDATE statement is sometimes called a jumping control because it instructs the program to "jump to" some specific area of the code. _________________________ FALSE GOTO Which of the following code fragments tells the system to look up the data type of a database column and use it for the declared variable? a. DECLARE order NUMBER(2) := 4; total_amt NUMBER(2); BEGIN --- executable code --- END; b. DECLARE ity%TYPE; total_amt NUMBER(2); BEGIN --- executable code --- END; c. DECLARE ity#TYPE; total_amt NUMBER(2); BEGIN --- executable code --- END; d. DECLARE order CONSTANT NUMBER(2) := 4; total_amt NUMBER(2); BEGIN --- executable code --- END; b. DECLARE ity%TYPE; total_amt NUMBER(2); BEGIN --- executable code --- END; A(n) ____ can store and handle multiple values of different data types as one unit. a. composite data type b. collection c. record d. block a. composite data type A(n) ____ is a variable that can store and handle multiple values of the same data type as one unit. a. composite data type b. collection c. record d. assignment statement b. collection A(n) ____ of data typically includes a number of different fields. a. row b. collection c. assignment statement d. variable a. row Which of the following code fragments correctly creates a record data type that will hold four variables? a. DECLARE TYPE type_basket IS RECORD ( basket bb_Basket %TYPE, created bb_ated%TYPE, sub bb_tal %TYPE); rec_basket type_basket; BEGIN --- executable code --- END; b. DECLARE TYPE type_basket IS RECORD ( basket bb_Basket%TYPE, created bb_ated%TYPE, qty bb_ity%TYPE, sub bb_tal%TYPE; rec_basket type_basket; BEGIN --- executable code --- END; c. DECLARE TYPE type_basket IS RECORD ( bb_ated%TYPE qty bb_ity%TYPE, sub bb_tal%TYPE); rec_basket type_basket; BEGIN --- executable code --- END; d. DECLARE TYPE type_basket IS RECORD ( basket bb_Basket%TYPE, created bb_ated%TYPE, qty bb_ity%TYPE, sub bb_tal%TYPE ); rec_basket type_basket; BEGIN --- executable code --- END; d. DECLARE TYPE type_basket IS RECORD ( basket bb_Basket%TYPE, created bb_ated%TYPE, qty bb_ity%TYPE, sub bb_tal%TYPE ); rec_basket type_basket; BEGIN --- executable code --- END; DECLARE TYPE type_basket IS RECORD( basket bb_Basket%TYPE, created bb_ated%TYPE, total bb_%TYPE, qty bb_ity%TYPE, sub bb_tal%TYPE); rec_basket type_basket; BEGIN --- executable code --- END; According to the code fragment above, which variable is declared using the type_basket data type? a. basket b. rec_basket c. sub d. qty b. rec_basket
Document information
- Uploaded on
- November 2, 2022
- Number of pages
- 9
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers