This blog post on Oracle 11g PL/SQL contains practice Multiple Choice Questions on Handling Data in PLSQL Blocks. These Multiple Choice Questions for Handling Data in PLSQL Blocks will help entry level Database programmers to answer most common Oracle 11g PL/SQL Interview Questions.

Oracle 11g PL/SQL Handling Data in PLSQL Blocks Multiple Choice Questions

1. 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
 order.quantity%TYPE;
 total_amt NUMBER(2);
BEGIN
 --- executable code --- 
END;
c. DECLARE
 order.quantity#TYPE;
 total_amt NUMBER(2);
BEGIN
 --- executable code --- 
END;
d. DECLARE
 order CONSTANT NUMBER(2) := 4;
 total_amt NUMBER(2);
BEGIN
 --- executable code --- 
END;

ANS: B


2. 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

ANS: A


3. 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

ANS: A

Also Read : Introduction to Oracle 11g PL/SQL Practice Question and Answers


4. A(n) ____ of data typically includes a number of different fields.

a. row

b. collection

c. assignment statement

d. variable

ANS: A


5. 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.idBasket %TYPE,
 created bb_basket.dtcreated%TYPE,
 sub bb_basket.subtotal %TYPE);
 rec_basket type_basket;
BEGIN
 --- executable code ---
END;
b. DECLARE
 TYPE type_basket IS RECORD (
 basket bb_basket.idBasket%TYPE,
 created bb_basket.dtcreated%TYPE,
 qty bb_basket.quantity%TYPE,
 sub bb_basket.subtotal%TYPE;
 rec_basket type_basket;
BEGIN
 --- executable code ---
END;
c. DECLARE
 TYPE type_basket IS RECORD (
 bb_basket.dtcreated%TYPE
 qty bb_basket.quantity%TYPE,
 sub bb_basket.subtotal%TYPE);
 rec_basket type_basket;
BEGIN
 --- executable code ---
END;
d. DECLARE
 TYPE type_basket IS RECORD (
 basket bb_basket.idBasket%TYPE,
 created bb_basket.dtcreated%TYPE,
 qty bb_basket.quantity%TYPE,
 sub bb_basket.subtotal%TYPE );
 rec_basket type_basket;
BEGIN
 --- executable code ---
END;

ANS: D


6.  DECLARE
 TYPE type_basket IS RECORD(
 basket bb_basket.idBasket%TYPE,
 created bb_basket.dtcreated%TYPE,
 total bb_basket.cost%TYPE,
 qty bb_basket.quantity%TYPE,
 sub bb_basket.subtotal%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

ANS: B

Also Read : Oracle 11g PL/SQL Handling Data in PLSQL Blocks Practice Questions


7. Which of the following code fragments correctly uses a record variable to hold the row of data queried for a shopper?

a. DECLARE
 rec_shopper bb_shopper%ROWTYPE;
BEGIN
 SELECT*
 INTO rec_shopper
 FROM bb_shopper
 WHERE idshopper = :g_shopper;
 DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
 DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
 DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
b. DECLARE
 rec_shopper bb_shopper%ROW;
BEGIN
 SELECT*
 INTO rec_shopper
 FROM bb_shopper
 WHERE idshopper = :g_shopper;
 DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
 DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
 DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
c. DECLARE
 rec_shopper bb_shopper%TYPE;
BEGIN
 SELECT*
 INTO rec_shopper
 FROM bb_shopper
 WHERE idshopper = :g_shopper;
 DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
 DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
 DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
d. DECLARE
 rec_shopper bb_shopperROWTYPE;
BEGIN
 SELECT*
 INTO rec_shopper
 FROM bb_shopper;
 WHERE idshopper = :g_shopper;
END;

ANS: A


8. tbl_basketitems(5).idproduct := :g_prod;

According to the above statement, which of the following indicates the field into which a value will be placed?

a. idproduct

b. tbl_basketitems

c. :g_row

d. :g_prod

ANS: A

Also Read : Oracle 11g PL/SQL Practice Questions for Interview


9. Which of the following allows a table of records value to persist for a user session?

a. Declaring the table of records variable in a row specification.

b. Declaring the table of records variable in a cursor specification.

c. Declaring the table of records variable in a record specification.

d. Declaring the table of records variable in a package specification.

ANS: D


10. Which of the following statements about collections is NOT true?

a. Collections are similar to arrays.

b. An index allows references to individual values or rows within a collection.

c. A collection may hold many rows of data and many fields.

d. The values in each row of the collection must be of the same type.

ANS: C

Also Read : Oracle 11g PL/SQL Basic Block Structures Completion Questions


11. A(n) ____ is a variable that can handle many rows of data but only one field.

a. assignment statement

b. associative array

c. collection

d. table attribute

ANS: B


12. ____ are functions that can be used in conjunction with table variables and allow greater ability to manipulate table values.

a. Associative array

b. Assignment statements

c. Collections

d. Table attributes

ANS: D


13. Which of the following attributes is available to enable movement through the associative array data?

a. COUNT

b. DELETE

c. PRIOR

d. EXISTS

ANS: C

Also Read : Oracle 11g PL/SQL Basic Block Structures Questions for Interview


14. Which of the following associative array attributes checks to see if a value has been entered for the stated index number?

a. COUNT

b. FIRST

c. PRIOR

d. EXISTS

ANS: C


15. One major advantage of using ____ as part of the physical database is being able to retrieve multiple values with a query of a single column.

a. cursors

b. collections

c. index by tables

d. variables

ANS: B


16. Which of the following is sometimes called a jumping control because it instructs programs to “jump to” some specific area of the code?

a. GO TO statement

b. GOTO statement

c. GO_TO statement

d. JUMP statement

ANS: B


17. The ____ markers are used in PL/SQL to identify a label.

a. <>

b. “”

c. << >>

d. :=

ANS: C


18. Which of the following statements is incorrect?

a. The GOTO action interrupts the flow of execution, making it very difficult to understand and maintain the code

b. Even though the GOTO statement exists, most developers believe this should be used very sparingly.

c. Most developers believe that the GOTO statement should be used as many times as possible.

d. Even though the GOTO statement exists, most developers believe this should be used only if no other method can be used to accomplish the task at hand.

ANS: C


Oracle 11g PL/SQL Handling Data in PLSQL Blocks Completion Questions

http://techhowdy.com/wp-content/uploads/2017/10/Oracle-11g-PLSQL-5.pnghttp://techhowdy.com/wp-content/uploads/2017/10/Oracle-11g-PLSQL-5-150x150.pngDemonDatabase Programmingdata in plsql,data in plsql blocks,declaring the table of records,executable code,handling data in plsql,handling data in plsql blocks,idshopper = g_shopper,Oracle 11g PLSQL,questions on handling data,table of records variableThis blog post on Oracle 11g PL/SQL contains practice Multiple Choice Questions on Handling Data in PLSQL Blocks. These Multiple Choice Questions for Handling Data in PLSQL Blocks will help entry level Database programmers to answer most common Oracle 11g PL/SQL Interview Questions. Oracle 11g PL/SQL Handling Data in PLSQL Blocks Multiple...Latest technology news