IP
CLASS : XII
MySQL
Numeric & Aggregate Functions in MySQL
Learning Outcomes
NUMERIC FUNCTIONS
1. MOD( )
2. POWER( )/POW( )
3. ROUND( )
4. SIGN( )
5. SQRT( )
6. TRUNCATE( )
The numeric functions are those functions that accept numeric values and after performing the required operation, return numeric values.
Some commonly used numeric functions are :
SNo | PName | Cost |
1 | Keyboard | 730 |
2 | Mouse | 325 |
3 | Projector | 45000 |
4 | Monitor | 5600 |
Sample Table: Peripherals
1.MOD( )
This function returns modulus (i.e.,remainder) of given two numbers
Syntax: MOD(m,n), M%N, M MOD N
2.POWER( )/POW( )
This function returns mn
ie., a number m raised to the nth power.
3.ROUND( )
This function returns a number rounded off as per given specification.
1.Avg( )
2.Count( )
3.Min( )
4.Max( )
5. Sum( )
Aggregate Functions
In MySQL, aggregate functions are used to perform calculations on a set of values and return a single result.
These functions operate on multiple rows and produce a single value as the result.
Some commonly used aggregate functions are :
1.Avg( )
This function computes the average of given data.
2. COUNT( )
This function counts the number of rows in a given column or expression.
3. MIN( )
This function returns the minimum value from a given column or expression.
4. MAX( )
This function returns the maximum value from a given column or expression.
5.SUM( )
This function returns the sum of values in a given column or expression.
Thank you Dear….