Open In App

Categories of SQL Functions

SQL Functions are developed into Oracle Database and are available to use in various appropriate SQL Statements. Functions in SQL and User defined function in Pl/SQL both are different. 

In query, if you call a SQL function with an argument with different datatype other than expected by the function, then Oracle will convert the argument datatype to the expected datatype before performing the SQL function and if you call function with null argument, it will return null. 



Categories of Functions: 

1. Single_row_function
2. Aggregate_function
3. Analytic_function
4. Model_function
5. User_defined_function 
6. Scalar functions 

Some of these functions are explained as following below. 



SELECT AVG(MAX(salary) 
FROM employees 
GROUP BY department_id

AVG(MAX(salary))
----------------
         10925 

Most frequently used Aggregate functions are AVG, COUNT, DENSE_RANK, MAX, MIN, RANK, SUM

Input: SELECT UCASE(geeksforgeeks) ;
Output: GEEKSFORGEEKS 

Most frequently used Scalar functions are UCASE() to convert a field to upper case, LCASE() to convert a field to lower case, LEN() to find the length of a text field, ROUND() to round the number of decimals specified, NOW() to find the current system date and time. 

Article Tags :