Q1
True / FalseIn ORACLE, a function is a named PL/SQL block that returns a single value.
A function in ORACLE is a named PL/SQL block designed to perform a specific task and return a single value.
Q2
True / FalseIn ORACLE, functions can be used in SQL statements, such as SELECT or WHERE clauses.
Functions can be used in SQL statements to perform calculations and return values within SELECT, WHERE, and other clauses.
Q3
True / FalseIn ORACLE, functions cannot accept parameters.
Functions can accept parameters, allowing them to perform operations based on the provided input values.
Q4
True / FalseIn ORACLE, a function must include a RETURN clause that specifies the data type of the returned value.
A function must specify a return data type using the RETURN clause and include a RETURN statement to return a value of that type.
Q5
True / FalseIn ORACLE, functions can only perform read operations and cannot modify database data.
While functions are generally used for calculations and returning values, they can modify database data, though it is not a recommended practice due to potential side effects.
Q6
True / FalseIn ORACLE, functions can be used to encapsulate reusable logic and improve code modularity.
Functions help encapsulate reusable logic, promoting code reuse and modularity.
Q7
True / FalseIn ORACLE, a function can be part of a package to group related functions together.
Functions can be included in packages, which group related procedures, functions, and other PL/SQL constructs together for better organization.
Q8
True / FalseIn ORACLE, a function can be overloaded, meaning multiple functions can have the same name but different parameters.
Function overloading allows multiple functions to have the same name as long as their parameter lists differ, enhancing flexibility and usability.
Q9
True / FalseIn ORACLE, a function that modifies data must be declared with the PRAGMA AUTONOMOUS_TRANSACTION directive to avoid affecting the calling transaction.
The PRAGMA AUTONOMOUS_TRANSACTION directive allows a function to run in its own transaction, ensuring that any data modifications do not affect the calling transaction.
Q10
True / FalseIn ORACLE, a function used in a SELECT statement should not perform DML operations to ensure it does not cause side effects.
To maintain the purity of SQL queries and avoid unintended side effects, functions used in SELECT statements should not perform DML operations.
Q20
Multiple ChoiceSelect the SQL statements that demonstrate the creation of a function that performs a complex calculation in Oracle.
Complex calculations in functions require the use of mathematical expressions and logic. The correct SQL statements will define the calculation and return the result.