Oracle 11g PL/SQL Basic Block Structures Completion Questions
This blog post on Oracle 11g PL/SQL Basic Block Structures Practice Completion Questions for Interview will help entry level Database programmers to answer most common Oracle 11g PL/SQL Questions. Fill int he blanks with appropriate PLSQL terms.
1. The ____________________ section of the PL/SQL block contains code that creates variables, cursors, and types.1. The ____________________ section of the PL/SQL block contains code that creates variables, cursors, and types.
2. A(n) ____________________ variable can hold only a single value.
3. _____________________ statements are used to put or change values in variables.
4. The ____________________ section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs during the executable statements in the BEGIN section.
5. To declare a variable, you must supply a variable name and ____________________.
ANS: data type
6. The code order NUMBER(2) := 6; is an example of a(n) ____________________.
ANS: assignment statement
7. The ____________________ option can be added to the variable declaration to require the variable to always contain a particular value within the block.
8. The ____________________ statement is a mechanism that allows the checking of a condition to determine whether or not statements should be processed.
9. The simple IF statement performs an action only if the condition is ____________________.
10. A(n) ____________________ statement does not use a selector but individually evaluates conditions that are placed in the WHEN clauses.
ANS: Searched CASE
11. ____________________ are used for situations in which we need to repeat a line or lines of code within our block.
12. If the EXIT WHEN clause is not included in the basic loop, the result is the programmer’s nightmare of a(n) ____________________.
ANS: infinite loop
13. By indicating a numeric range, the ____________________ dictates exactly how many times the loop should run in the opening LOOP clause.
ANS: FOR loop
14. The ____________________ loop is constructed with conditions in the LOOP statement to determine when the looping action begins and ends.
ANS: WHILE FOR
Oracle 11g PL/SQL Basic Block Structures Essay Questions
1. What is the purpose of the BEGIN section of a PL/SQL block?
ANS: The BEGIN section is the heart of the PL/SQL block in that it contains all the processing action, or programming logic. SQL is used for database queries and data manipulation. Conditional logic, such as IF statements, is used to make decisions on what action to take. Loops are used to repeat code and assignment statements are used to put or change values in variables.
2. What is the purpose of control structures?
ANS: Control structures provide the capability to perform conditional logic to determine which statements should be run, how many times the statements should be run, and the overall sequence of events.