Functions MCQ Questions And Answers
Functions MCQs : This section focuses on "Functions" 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 standalone function is created using the _________ statement.
A. ALTER FUNCTION
B. CREATE FUNCTION
C. REPEAT FUNCTION
D. INSERT FUNCTION
View Answer
Ans : B
Explanation: A standalone function is created using the CREATE FUNCTION statement.
2. The function must contain a return statement.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, The function must contain a return statement.
3. The _____ keyword is used instead of the _____ keyword for creating a standalone function.
A. AS, AS
B. IS, IS
C. AS, IS
D. IS, AS
View Answer
Ans : C
Explanation: The AS keyword is used instead of the IS keyword for creating a standalone function.
4. The _____________ clause specifies the data type you are going to return from the function.
A. EXIT
B. CONTINUE
C. REPEAT
D. RETURN
View Answer
Ans : D
Explanation: The RETURN clause specifies the data type you are going to return from the function.
5. The optional parameter contains _______ parameters.
A. name
B. mode
C. types
D. All of the above
View Answer
Ans : D
Explanation: The optional parameter list contains name, mode and types of the parameters.
6. _______ represents the value that will be passed from outside.
A. IN
B. OUT
C. IN OUT
D. All of the above
View Answer
Ans : A
Explanation: IN represents the value that will be passed from outside
7. Which of the following is NOT present in the syntax of PL/SQL function?
A. Function_name
B. [OR REPLACE]
C. Optional Parameter List
D. None of the above
View Answer
Ans : D
Explanation: Function_name, [OR REPLACE], Optional Parameter List, IN are all present in the syntax of PL/SQL function.
8. PL/SQL function must contain a
A. Follow Statement
B. GOTO Statement
C. Return Statement
D. NULL Statement
View Answer
Ans : C
Explanation: PL/SQL function must contain a Return Statement.
9. We can demonstrate which of the following in a PL/SQL function?
A. Declare
B. Define
C. Invoke
D. All of the above
View Answer
Ans : D
Explanation: We can demonstrate Declare, Define and Invoke in PL/SQL function.
10. A function is same as a procedure except that it returns a value.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, A function is same as a procedure except that it returns a value.
Discussion