Table of Contents
Question
Which three are true about user-defined functions? (Choose three.)
A. They can be used in ORDER BY and GROUP BY clauses.
B. They can be executed as standalone commands.
C. They must be defined with at least one parameter.
D. They need not return any values.
E. They can appear in the select list of a SELECT statement.
F. Functions can call only other functions.
G. They can be used in CONNECT BY and START WITH clauses.
Answer
A. They can be used in ORDER BY and GROUP BY clauses.
E. They can appear in the select list of a SELECT statement.
G. They can be used in CONNECT BY and START WITH clauses.
Explanation
The correct answers are:
A. They can be used in ORDER BY and GROUP BY clauses.
E. They can appear in the select list of a SELECT statement.
G. They can be used in CONNECT BY and START WITH clauses.
A. They can be used in ORDER BY and GROUP BY clauses.
This is true. User-defined functions can be used in ORDER BY and GROUP BY clauses.
B. They can be executed as standalone commands.
This is false. Functions cannot be executed standalone, they must be called from a SQL statement or PL/SQL block.
C. They must be defined with at least one parameter.
This is false. Functions can be defined with zero parameters.
D. They need not return any values.
This is false. Functions must return a value.
E. They can appear in the select list of a SELECT statement.
This is true. Functions can be used in the select list.
F. Functions can call only other functions.
This is false. Functions can call procedures, triggers, and other functions.
G. They can be used in CONNECT BY and START WITH clauses.
This is true. Functions can be used in CONNECT BY and START WITH clauses.
So the correct answers are A, E, and G.
Reference
- User Defined Function (oracle.com)
- SQL Language Reference (oracle.com)
- User Defined Functions in PL/SQL (Intro) (relationaldbdesign.com)
- sql – How do I call a User Defined Function to use with select, group by, order by? – Stack Overflow
- User-Defined Functions – SQL Server | Microsoft Learn
- Create User-defined Functions (Database Engine) – SQL Server | Microsoft Learn
Oracle Database Program with PL/SQL 1z0-149 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Oracle Database Program with PL/SQL 1z0-149 exam and earn Oracle Database Program with PL/SQL 1z0-149 certification.