What is Functions?

A function is a tool (or built-in operation) that performs a specific task and returns a value.

Types of Functions

Stakeholder Map Team Whiteboard in Green Yellow Purple Trendy Stickers Style (8).png

Scalar Functions:

These functions perform a calculation on a single value and return a single value.

Stakeholder Map Team Whiteboard in Green Yellow Purple Trendy Stickers Style (9).png

  1. UPPER(): Converts a text string to uppercase.
  2. LOWER(): Converts a text string to lowercase.
SELECT 
    Name, 
    UPPER(Name) AS UppercaseName
    LOWER(Name) AS LowercaseName
FROM Employees;
  1. ROUND (): ROUND() function rounds a number to a specified number of decimal places.
SELECT ROUND(price, 2) AS rounded_price
FROM products;