Which two statements are true? (Choose two)

  1. a) A function must return a value.

  2. b) A procedure must return a value.

  3. c) A function executes a PL/SQL statement.

  4. d) A function is invoked as part of an expression.

  5. e) A procedure must have a return data type specify in its declaration.


Correct Option: A,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) A function must return a value - This option is correct. A function is a subprogram that performs a specific task and returns a value. When a function is executed, it calculates a value and returns it to the calling program.

Option B) A procedure must return a value - This option is incorrect. Unlike a function, a procedure does not have to return a value. A procedure is a subprogram that performs a specific task, but it does not return a value.

Option C) A function executes a PL/SQL statement - This option is incorrect. A function can execute multiple PL/SQL statements, but it is not limited to executing only PL/SQL statements. A function can also perform calculations, access database tables, and perform other operations.

Option D) A function is invoked as part of an expression - This option is correct. A function can be called within an expression to perform a specific calculation or operation. The result of the function call is then used as part of the overall expression.

Option E) A procedure must have a return data type specified in its declaration - This option is incorrect. As mentioned earlier, a procedure does not have to return a value. Therefore, it does not require a return data type to be specified in its declaration.

The two statements that are true are Option A) A function must return a value, and Option D) A function is invoked as part of an expression.

Find more quizzes: