SQL Functions
In this section we have compiled SQL cheat sheet for SQL functions. It is used for common tasks like aggregation, filtering, date/time manipulation, and more!
51. Scalar Functions: Functions That Return a Single Value
SELECT UPPER(first_name) AS upper_case_name FROM employees;
This query uses the UPPER() scalar function to convert the first_name column values to uppercase.
52. Aggregate Functions: Functions That Operate on a Set of Values and Return a Single Value
SELECT AVG(salary) AS average_salary FROM employees;
This query uses the AVG() aggregate function to calculate the average salary of all employees.
53. String Functions: Functions That Manipulate String Values
SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM employees;
This query uses the CONCAT() string function to concatenate the first_name and last_name columns into a single column called full_name.
54. Date and Time Functions: Functions That Operate on Date and Time Values
SELECT CURRENT_DATE AS current_date FROM dual;
This query uses the CURRENT_DATE date function to retrieve the current date.
55. Mathematical Functions: Functions That Perform Mathematical Operations
SELECT SQRT(25) AS square_root FROM dual;
This query uses the SQRT() mathematical function to calculate the square root of 25.
SQL Cheat Sheet
In this article, we will explore the ultimate SQL cheat sheet with the PDF, covering a wide range of SQL commands, Joins in SQL, CRUD Operations, SQL Trigger, SQL Transactions, and advanced topics to help master SQL effectively.
SQL (Structured Query Language) is a Query language used for managing and manipulating relational databases databases. It allows users to interact with databases. SQL allows users to perform various tasks such as querying data, updating data, inserting new records, deleting records, creating and modifying database schemas, and managing permissions.
Table of Content
- Create a Database in SQL
- Creating Data in SQL
- Reading/Querying Data in SQL
- Updating/Manipulating Data in SQL
- Deleting Data in SQL
- Filtering Data in SQL
- SQL Operator
- Aggregation Data in SQL
- Constraints in SQL
- Joins in SQL
- SQL Functions
- Subqueries in SQL
- Views in SQL
- Indexes in SQL
- Transactions in SQL
- Advanced Mixed Data in SQL
- SQL Cheat Sheet PDF
Contact Us