DEV Community

Adam
Adam

Posted on

SQL Aggretate functions

The purpose of using Aggregate functions in sql is to combinding data to perform and return a single value, there are multiple ways to you can manipulate large amounts of data to simplify to one single value.

  • AVG() - Calculates the average or mean of values for a specific column, mostly used for integer based columns.
  • COUNT() - Returns a number of records from a particular column.
  • MIN() - This function returns the smallest value of a selected column
  • MAX() - This function returns the largest value of a selected column
  • SUM() - This adds all values on a numeric column
  • FIRST() - This will return the first value of a selected column.
  • LAST() - grabs the last value/element of a particular column in your table
  • LEN() - This calculates the length of a string of a particular column
  • UCASE() - This takes string values of a column and uppercase the string
  • LCASE() - This takes the string of a column and lowercases the value
  • MID() - extracts the substring of string values in a collection
  • CONCAT() - combines two or more strings
  • RAND() - generates a random number from a given range
  • ROUND() - this rounds a number from a given user defined number
  • NOW() - This returns the current date and time
  • FORMAT() - formats a value with a specific format

Top comments (0)