Oracle Database Programming MCQs with Answers
Practice important Oracle Database Programming MCQs with answers and explanations.
Multiple Choice Questions
Q271: What is a primary purpose of using a PL/SQL procedure?
- A: To perform specific tasks efficiently
- B: To create database tables
- C: To define new database structures
- D: To manage database users
View Answer
A
Q272: What type of parameter does not allow modification of its value inside a PL/SQL procedure?
- A: IN
- B: OUT
- C: IN OUT
- D: TEMP
View Answer
A
Q273: What is the major difference between a function and a procedure in PL/SQL?
- A: A function must return a value, whereas a procedure may or may not return a value
- B: A function can only take IN parameters, while a procedure can take IN and OUT parameters
- C: A function can perform multiple tasks, while a procedure performs a specific task
- D: A function cannot be called multiple times, whereas a procedure can
View Answer
A
Q274: Which keyword is used to create a function in PL/SQL?
- A: CREATE FUNCTION
- B: CREATE PROCEDURE
- C: CREATE OR REPLACE FUNCTION
- D: CREATE OR REPLACE PROCEDURE
View Answer
C
Q275: What is the purpose of the `RETURN` statement in a PL/SQL function?
- A: It terminates the function execution
- B: It specifies the datatype of the function result
- C: It returns a value to the calling environment
- D: It defines the function’s parameters
View Answer
C
Q276: In PL/SQL, what type of parameter can be both input and output?
- A: IN parameter
- B: OUT parameter
- C: INOUT parameter
- D: INOUT parameter cannot be used
View Answer
B
Q277: Which of the following is true about a PL/SQL procedure?
- A: It can return multiple values
- B: It must always return a value
- C: It can be created to perform a specific task
- D: It is used primarily for computation
View Answer
C
Q278: What does the `CREATE OR REPLACE FUNCTION` statement do?
- A: It creates a new function or replaces an existing function
- B: It deletes an existing function
- C: It creates a new procedure or replaces an existing procedure
- D: It alters the structure of an existing function
View Answer
A
Q279: In the syntax `CREATE OR REPLACE FUNCTION function_name RETURN return_datatype`, what does `return_datatype` specify?
- A: The name of the function
- B: The datatype of the value the function returns
- C: The parameters the function accepts
- D: The body of the function
View Answer
B
Q280: What is the result of the following PL/SQL block if the function `totalemployees` is defined incorrectly?
- A: An error message will be displayed
- B: The function will execute successfully
- C: The function will return zero employees
- D: The function will return an incorrect number of employees
View Answer
A