SQL has many built-in functions for performing operations on numeric or string values. The following is the list of all useful SQL functions with examples:
-
COUNT (): It is used to returns the number of rows.
-
AVG (): It is used to returns the average value.
-
MAX (): It is used to returns the largest value.
-
MIN (): It is used to returns the smallest value.
-
SUM (): It is used to returns the sum.
-
LEN (): It is used to returns the length of a text field.
-
UPPER (): It is used to converts a field to upper case.
-
LOWER (): It is used to converts a field to lower case.
-
GETDATE (): It returns the current date and time from the server's system clock.
-
DATEDIFF(): It is used to compare and return the difference between date items such as days, weeks, minutes, and hours.
AVG () Function: This function returns the average value of a numeric column.
Syntax: SELECT AVG (column_name) FROM table_name

COUNT () Function: This function returns the number of rows that match a specified criteria.
Syntax: SELECT COUNT(column_name) FROM table_name;

MAX () Function: This function returns the largest value of the selected column.
Syntax: SELECT MAX (column_name) FROM table_name;

MIN () Function: This function returns the smallest value of the selected column.
Syntax: SELECT MIN (column_name) FROM table_name;

SUM () Function: This function returns the total sum of a numeric column.







