Lesson 12
Intermediate Level
12 of 30 lessons
Built-in Functions
Learn about string, numeric, and date functions in Oracle SQL. Built-in functions are powerful tools for data manipulation and analysis.
What Are Built-in Functions?
Built-in functions in Oracle SQL help perform operations on data such as formatting, calculations, conversions, and summaries. These functions return either single results or grouped aggregates.
Types of Functions
- Single Row Functions – operate on each row and return one result per row (e.g., UPPER, LOWER, LENGTH, SYSDATE)
- Group Functions – operate on groups of rows and return a single result for each group (e.g., SUM, AVG, COUNT, MAX, MIN)
Examples
-- Convert name to uppercase
SELECT UPPER(first_name) FROM employees;
-- Get length of a name
SELECT LENGTH(first_name) FROM employees;
-- Count total employees
SELECT COUNT(*) FROM employees;
-- Calculate average salary
SELECT AVG(salary) FROM employees;
-- Get current date
SELECT SYSDATE FROM dual;
Practice Task
- Display all employee names in lowercase using
LOWER(). - Show the maximum and minimum salaries from the employee table.
- Find how many employees were hired in total using
COUNT(*). - Use
SYSDATEto display today’s date.