Useful Functions in SQL


Following is the list of all useful SQL built-in functions:


  •    COUNT - The SQL COUNT aggregate function is used to count the number of rows in a database table.
  •    SQRT - This is used to generate a square root of a given number.
  •    RAND - This is used to generate a random number using SQL command.
  •    MAX - The SQL MAX aggregate function allows us to select the highest (maximum) value for a certain column.
  •    MIN - The SQL MIN aggregate function allows us to select the lowest (minimum) value for a certain column.
  •    CONCAT - This is used to concatenate any string inside any SQL command.
  •    Numeric - Complete list of SQL functions required to manipulate numbers in SQL.
  •    String - Complete list of SQL functions required to manipulate strings in SQL.
  •    AVG - The SQL AVG aggregate function selects the average value for certain table column.
  •    SUM - The SQL SUM aggregate function allows selecting the total for a numeric column.

Why we can't execute a stored procedure from a User Defined function(UDF)

Functions cannot "touch" any database but read them only. Stored procedures can do anything and everything with databases. You ...