Dbms Lab (Experiment - 1) : 1. Single Row Numeric Functions A) ABS
Dbms Lab (Experiment - 1) : 1. Single Row Numeric Functions A) ABS
(EXPERIMENT _1)
1. SINGLE ROW NUMERIC FUNCTIONS
a) ABS ( )
b) CEIL( )
Description : The CEIL( ) function returns the smallest integer value that is larger
than or equal to that number.
Syntax : CEIL(number)
Example Query : select CEIL(-25.7) from dual;
Output :
c) FLOOR ( )
Description : The FLOOR( ) function returns largest integer value that is smaller
than or equal to a number.
Syntax : FLOOR(number)
Example Query : select FLOOR(-28.7) from dual;
Output :
d) MOD( )
Description : The MOD( ) function returns the remainder when first number is
divided by second.
Syntax : MOD(dividend,divisor)
Example Query : select MOD(19,3) from dual;
Output :
e) POWER ( )
Description : The POWER( ) function returns the value when a number n is raised
to a power x .
Syntax : POWER(base,exponent)
Example Query : select POWER(2,3) from dual;
Output :
f) ROUND ( )
g) SIGN ( )
h) SQRT ( )
Description : The SQRT( ) function returns the square root of the number. If the
number is irrational, it displays upto 38 decimals.
Syntax : SQRT(number)
Example Query : select SQRT(13) from dual;
Output :
i) TRUNC ( )
Output :
j) SIN ( )
Description : The SIN( ) function returns the sine value for x radians.
Syntax : SIN(x)
Example Query : select SIN(1.567) from dual;
Output :
k) COS ( )
Description : The COS( ) function returns the cosine value for x radians.
Syntax : COS(x)
Example Query : select COS(1.567) from dual;
Output :
l) EXP ( )
m) LN ( )
a) CHR( )
Description :CHR( ) function converts any numerical value into its equivalent
ASCII Character.
Syntax : CHR(ASCII Code)
Example Query : select CHR(116) from dual;
Output :
b) LOWER( )
c) UPPER( )
d) INITCAP( )
Description :It is used in padding the left side of a string with a specific set of
characters useful for formatting the output of a query. A number
indicating the total length of the string is returned after padding.
Syntax : LPAD(string,length,character(s))
Example Query : select LPAD('pandu',10,'xy') from dual;
Output :
f) RPAD( )
Description :It is used in padding the right side of a string with a specific set of
characters useful for formatting the output of a query. A number
indicating the total length of the string is returned after padding.
Syntax : RPAD(string,length,character(s))
Example Query : select RPAD('pandu',10,'xy') from dual;
Output :
g) RTRIM( )
Description :It returns the string by removing trim_string from the right of the
given and string .
Syntax : RTRIM(string[,trim_string] )
Example Query : select RTRIM('PANDU','U') from dual;
Output :
h) LTRIM( )
Description : It returns the string by removing trim_string from the left of the
given and string .
Syntax : LTRIM(string,[trim_string] )
Example Query : select LTRIM('PANDU','PA') from dual;
Output :
i) SUBSTR( )
j) REPLACE( )
k) TRANSLATE( )
l) CONCAT( )
Output :
1)
2)
m) INSTR( )
n) ASCII( )
o) LENGTH( )
p) REVERSE( )