Functions
Functions
Output: 10
Output: 15.68
3. POWER() - Exponentiation:
Meaning: Raises a number to the power of
another.
Syntax: POWER(base, exponent)
Example: POWER(2, 3)
Output: 8
4. EXP() - Exponential:
Meaning: Returns e raised to the power of a
specified number.
Syntax: EXP(number)
Example: EXP(2)
Output: 7.3890560989306495
Output: 2.302585092994046
6. PI() - Pi Constant:
Meaning: Returns the mathematical constant pi.
Syntax: PI()
Example: PI()
Output: 3.141592653589793
Numerical Functions:
Example: RAND()
Output: 0.837419287
Syntax: SQRT(number)
Example: SQRT(25)
Output: 5
3. AVG() - Average:
Meaning: Returns the average value of a numeric
column.
Syntax: AVG(column)
Example: AVG(salary)
Output: 55000
Example: COUNT(employee_id)
Output: 30
values.
Syntax: MAX(column)
Example: MAX(sales)
Output: 100000
Example: MIN(salary)
Output: 30000
Syntax: SQUARE(number)
Example: SQUARE(4)
Output: 16
numeric column.
Syntax: SUM(column)
Example: SUM(sales)
Output: 500000
String Functions:
Example: LENGTH('Hello')
Output: 5
Example: UPPER('hello')
Output: 'HELLO'
Syntax: LOWER(string)
Example: LOWER('WORLD')
Output: 'world'
Example: ASCII('A')
Output: 65
Syntax: CHAR(ascii_value)
Example: CHAR(65)
Output: 'A'
Output: 3
Logical Functions:
2. OR - Logical OR:
Meaning: Returns true if at least one condition is
true.
Syntax: condition1 OR condition2
Syntax: NOW()
Example: NOW()
Syntax: CURDATE()
Example: CURDATE()
Output: '2024-01-16'
Syntax: CURTIME()
Example: CURTIME()
Output: '14:30:00'
Syntax: YEAR(date)
Example: YEAR('2024-01-16')
Output: 2024
Syntax: MONTH(date)
Example: MONTH('2024-01-16')
Output: 1