Junior — Middle
Can you list the main aggregate functions used when working with SQL queries?
sobes.tech AI
Answer from AI
The main aggregate functions in SQL that are commonly used for data processing:
- COUNT() — counts the number of rows or values in a column.
- SUM() — calculates the sum of values in a column.
- AVG() — calculates the average value.
- MIN() — finds the minimum value.
- MAX() — finds the maximum value.
Example of usage:
SELECT COUNT(*), AVG(price), MIN(price), MAX(price) FROM products;