PL/SQL - Variables MCQ Questions And Answers
Variables MCQs : This section focuses on "Variables" in Pl/Sql. These Multiple Choice Questions (MCQ) should be practiced to improve the Pl/Sql skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. A _______ is nothing but a name given to a storage area that our programs can manipulate
A. object
B. constant
C. variable
D. literals
View Answer
Ans : C
Explanation: A variable is nothing but a name given to a storage area that our programs can manipulate
2. variable names are ?
A. case-sensitive
B. not case-sensitive
C. Both A and B
D. None of the above
View Answer
Ans : B
Explanation: variable names are not case-sensitive
3. When you provide a size, scale or precision limit with the data type, it is called a?
A. identifier declaration
B. non declaration
C. constrained declaration
D. unconstrained declaration
View Answer
Ans : C
Explanation: When you provide a size, scale or precision limit with the data type, it is called a constrained declaration
4. Constrained declarations require less memory than unconstrained declarations.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Constrained declarations require less memory than unconstrained declarations
5. How many types of variable scope?
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: There are two types of variable scope: Local variables and Global variables.
6. Variables declared in an inner block and not accessible to outer blocks known as?
A. Local variables
B. Global variables
C. Nested variable
D. None of the above
View Answer
Ans : A
Explanation: Local variables : Variables declared in an inner block and not accessible to outer blocks.
7. A Variable in PL/SQL should not exceed ________ characters ?
A. 10
B. 20
C. 30
D. 40
View Answer
Ans : C
Explanation: A Variable in PL/SQL should not exceed 30 characters.
8. Which of the following is/are TRUE about PL/SQL Variables?
A. Variables serve as a means for programmers to temporarily store data during code execution.
B. PL/SQL programs benefit from its use.
C. There is nothing special about it other than being the name of a storage area.
D. All of the above
View Answer
Ans : D
Explanation: All of the above are TRUE about PL/SQL Variables
9. 9. PL/SQL Variable needs to be declared in the ?
A. Variable Section
B. Declaration Section
C. Initialization Section
D. Exception Section
View Answer
Ans : B
Explanation: PL/SQL Variable needs to be declared in the Declaration Section.
10. PL/SQL assigns it a default value of NULL.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, PL/SQL assigns it a default value of NULL.
Discussion