Difficulty: Easy
Correct Answer: Incorrect
Explanation:
Introduction / Context:
This item checks your understanding of what a “function” is in database programming and general programming practice. Many learners confuse a function’s return value with its parameters and assume that functions should have only outputs. In reality, functions are typically designed to take input parameters, perform computation, and return exactly one value (or a single structured value) as their result. The claim here says a function “returns one value and has only output parameters,” which conflates roles and is misleading.
Given Data / Assumptions:
Concept / Approach:
In procedural thinking, a function is invoked with inputs and produces one return value. Procedures (or stored procedures) are the constructs that more commonly use OUT or IN OUT parameters to pass multiple results. While some platforms permit OUT parameters in functions at the procedural level, the dominant practice—especially when the function is used inside SQL—requires IN parameters only. Therefore, saying a function “has only output parameters” is incorrect; functions primarily accept inputs and return a value.
Step-by-Step Solution:
Verification / Alternative check:
Review platform rules: many DBMSs allow functions in SELECT/WHERE only if all parameters are IN. This reinforces the idea that functions are not “only outputs.”
Why Other Options Are Wrong:
Common Pitfalls:
Confusing procedures with functions; assuming OUT parameters define a function’s identity; forgetting that SQL-invoked functions must behave deterministically with IN parameters.
Final Answer:
Incorrect
Discussion & Comments