Pl/Sql - Packages MCQ Questions And Answers
Packages MCQs : This section focuses on "Packages" in Pl/Sql. These Multiple Choice Questions (MCQs) 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. How many mandatory parts packages has?
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: A package will have two mandatory parts : Package specification and Package body or definition
2. All objects placed in the specification are called __________ objects.
A. private
B. protected
C. public
D. None of the above
View Answer
Ans : C
Explanation: All objects placed in the specification are called public objects.
3. The __________ Statement is used for creating the package body.
A. CREATE
B. CREATE PACKAGE
C. CREATE BODY
D. CREATE PACKAGE BODY
View Answer
Ans : D
Explanation: The CREATE PACKAGE BODY Statement is used for creating the package body.
4. Packages are schema objects that groups logically related PL/SQL types, variables, and subprograms.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Packages are schema objects that groups logically related PL/SQL types, variables, and subprograms.
5. Which of the following are the advantages of PL/SQL Packages?
A. Modularity
B. Easier Application Design
C. Information Hiding
D. All of the above
View Answer
Ans : D
Explanation: All of the above are the advantages of PL/SQL Packages.
6. Any subprogram not in the package specification but coded in the package body is called a _________ object.
A. protected
B. private
C. self
D. public
View Answer
Ans : B
Explanation: Any subprogram not in the package specification but coded in the package body is called a private object.
7. The constructs of a procedure, function or a package are ________ .
A. Variables and Constants
B. Cursors
C. Exceptions
D. All of the above
View Answer
Ans : D
Explanation: The constructs of a procedure, function or a package are All of the above
8. The parameters can be passed as default also to the procedures and the functions.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, The parameters can be passed as default also to the procedures and the functions.
9. Which package lets PL/SQL programs read and write operating system (OS) text files?
A. UTL_HTTP
B. UTL_FILE
C. UTL_SMTP
D. UTL_FMT
View Answer
Ans : B
Explanation: UTL_FILE helps the PL/SQL programs read and write operating system text files. It provides a restricted version of the operating system stream file I/O.
10. The package specification is the interface to the package.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, The specification is the interface to the package.
Discussion