This blog post on Oracle 11g PL/SQL Basic Block Structures Practice Questions for Interview will help entry level Database programmers to answer most common Oracle 11g PL/SQL Questions

Oracle 11g PL/SQL Basic Block Structures True or False Questions for Interview

The term anonymous blocks refers to blocks of code that are not stored for reuse and do not exist after being executed.The term anonymous blocks refers to blocks of code that are not stored for reuse and do not exist after being executed.
ANS: True 
2. The only required sections of a PL/SQL block are DECLARE and END.
ANS: True
3. The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types.
ANS: False
4. Assignment statements are used to put or change the values of variables.
ANS: True 
5. The keyword DEFAULT can be used in place of the := symbol to assign initial values to the variables within the declaration statement.
ANS: True 
6. The LOOP statement is a mechanism that allows the checking of a condition to determine if statements should or should not be processed.
ANS: False
7. When an IF statement checks only one condition and performs actions only if the condition is TRUE, it is referred to as a simple IF condition.
ANS: True 
8. With respect to processing efficiency, the less code that has to be processed, the faster the program runs.
ANS: True 
9. The syntax of the following code fragment is correct:IF rec_order.state = ‘VA’ THEN    lv_tax_num := rec_order.sub * .06;ELSEIF rec_order.state = ‘ME’ THEN    lv_tax_num := rec_order.sub * .05;ELSE    lv_tax_num := rec_order.sub * .04;END IF
ANS: False 
10. The syntax of the following code fragment is correct.IF rec_order.state = ’VA’ THEN    lv_tax_num := rec_order.sub * .06;ELS IF rec_order.state = ’ME’ THEN    lv_tax_num := rec_order.sub * .05;END IF
ANS: False 
11. The CASE statement begins with the keyword CASE followed by a selector that is typically a variable name.
ANS: True 
12. The following code fragment is a correct example of the use of a basic loop.BEGIN   LOOP      DBMS_OUTPUT.PUT_LINE( lv_cnt_num );      lv_cnt_num := lv_cnt_num + 1;   END LOOP;END;
ANS: False 
13. An infinite loop causes a program to loop indefinitely, disrupting the ability of the code to continue with any processing beyond the loop.
ANS: True 
14. The EXIT WHEN clause ensures that a basic loop runs at least once.
ANS: True 
15. The following code fragment is a correct example of the use of a WHILE loop.BEGIN   WHILE lv_cnt_num <= 5       DBMS_OUTPUT.PUT_LINE( lv_cnt_num );      lv_cnt_num := lv_cnt_num + 1;   END LOOP;END;
ANS: False 
16. The following loop iterates four times.BEGIN   WHILE lv_cnt_num <= 5 LOOP      DBMS_OUTPUT.PUT_LINE( lv_cnt_num );      lv_cnt_num := lv_cnt_num + 1;   END LOOP;END;
ANS: False 
17. The following loop terminates when the lv_cnt_num variable holds a value of 6.BEGIN   WHILE lv_cnt_num <= 5 LOOP      DBMS_OUTPUT.PUT_LINE( lv_cnt_num );      lv_cnt_num := lv_cnt_num + 1;   END LOOP;END;
ANS: True
18. The following code fragment is a correct example of the use of a FOR loop.BEGIN    FOR i IN 1..5       DBMS_OUTPUT.PUT_LINE( i );      END LOOP;END;
ANS: False
19. Even though the EXIT clause can be used in any type of loop, it is considered good form to use the EXIT clause only in basic loops.
ANS: True


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


Oracle 11g PL/SQL Basic Block Structures Modified True or False Questions for Interview

1. The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types.

ANS: False  – Correct Answer :  The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types – DECLARE
2. A(n) scalar variable can hold only a single value.
ANS: True
3. The DECLARE section of the PL/SQL block contains all the processing action, or programming logic.
ANS: False   – Correct Answer :  The BEGIN section of the PL/SQL block contains all the processing action, or programming logic.
4. The EXCEPTION section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs.
ANS: True
5. Variables are named memory areas that hold values to allow retrieval and manipulation of values within your programs.
ANS: True
6. The common data types used for cursor variables include character, numeric, date, and Boolean.
ANS: False  –  scalar
7. When an IF statement checks only one condition and performs actions only if the condition is TRUE, it is referred to as a(n) simple IF condition.
ANS: True
8. The Searched CASE statement does not use a selector but individually evaluates conditions that are placed in the WHERE clauses.
ANS: False – WHEN
PTS: 1 REF: 66
9. A(n) CASE expression evaluates conditions and returns a value in an assignment statement.
ANS: True
10. Loops are used for situations in which we need to repeat a line or lines of code within our block.
ANS: True
11. The basic loop uses the LOOP and END LOOP markers to begin and end the loop code.
ANS: True
12. If the WHERE clause is not included the basic loop, the result is the programmer’s nightmare of the infinite loop.
ANS: False – EXIT WHEN
13. The basic loop dictates exactly how many times the loop should run in the opening LOOP clause.
ANS: False – FOR
14. To keep code efficient and minimize statement processing, any statements that are dynamic in nature should be placed outside a loop.
ANS: False – static


 

http://techhowdy.com/wp-content/uploads/2017/10/Oracle-11g-PLSQL-2.pnghttp://techhowdy.com/wp-content/uploads/2017/10/Oracle-11g-PLSQL-2-150x150.pngDemonDatabase ProgrammingThis blog post on Oracle 11g PL/SQL Basic Block Structures Practice Questions for Interview will help entry level Database programmers to answer most common Oracle 11g PL/SQL Questions Oracle 11g PL/SQL Basic Block Structures True or False Questions for Interview The term anonymous blocks refers to blocks of code that are not stored...Latest technology news