MySQL Functions with examples
MySQL functions are built-in tools in MySQL that help you perform tasks on your data, such as calculations, string manipulation, or date…
MySQL Functions with examples
MySQL functions are built-in tools in MySQL that help you perform tasks on your data, such as calculations, string manipulation, or date management.
They make queries easier by processing data directly in the database.

Screenshot By Author
What is a Function in MySQL?
- A function is a predefined set of SQL operations that returns a value.
- Used to perform calculations, manipulate strings, handle dates, etc.
- Functions return values; they can be used in SELECT, WHERE, and ORDER BY clauses.
Types of MySQL Functions
- String Functions
- Numeric Functions
- Date and Time Functions
- Aggregate Functions
- Control Flow Functions
Not a member yet? CLICK HERE to read the full article for free!!
- String Functions: These handle text or string data

Screenshot By Author
CONCAT(): Combine two or more strings
SELECT CONCAT('Hi', ' ', 'There');

String Functions
2. Numeric Functions: These work with numbers.

Screenshot By Author
ROUND(): Rounds a number to a specified number of decimal places.
SELECT ROUND(15.789, 2);

Numeric Functions
3. Date and Time Functions: These work with dates and times.

Screenshot By Author
NOW(): Returns the current date and time
SELECT NOW();

Date and Time functions
4. Aggregate functions: These perform calculations on a group of rows.

Screenshot By Author
COUNT(): Counts the number of rows.
SELECT COUNT(*) Employees;

Aggregate functions
5. Control Flow Functions: Control flow functions help you make decisions in your SQL queries, similar to if-else statements in programming.
CASE
WHEN score >= 90 THEN 'A'
WHEN score >= 80 THEN 'B'
ELSE 'C'
END

Control Flow functions
Functions are used in SQL queries, often in the SELECT statement, to process or transform data. They save time and make data handling easier.
MySQL functions are built-in operations that can be used to manipulate data, perform calculations, or return specific results.
Here are some more stories you might like
[embed]MySQL Triggers Trigger = A stored procedure that automatically runsmedium.com
[embed]Cursor in MySQL “Fetch Data Row-by-Row Using Cursors”medium.com
If you like my content, give me a few claps and follow for more!
Thanks for your time!
메타데이터
- post_id
- ae11a2aa1e1d
- slug
- mysql-functions-with-examples-ae11a2aa1e1d
- url
- https://medium.com/javarevisited/mysql-functions-with-examples-ae11a2aa1e1d
- canonical_url
- https://medium.com/javarevisited/mysql-functions-with-examples-ae11a2aa1e1d
- author_url
- https://medium.com/@talatwaheed
- status
- ok
- fetched_at
- 2026-08-27 16:25:01