Math Functions: =============== 1) abs(): --------- => convert the negative number into positive number. Syntax: abs(-number); |-9| ==> 9 |8| ==> 8 Query: select abs(-97) from dual; 2) round(): ----------- round(9.5) ==> 10 round(9.4) ==> 9 => round() can accept the floating-point value can return the nearest integer value. Syntax: round(any-float-value); Query: select round(9.5) from dual; select round(9.4) from dual; 3) floor(): ---------- floor(9.5) ==> 9 => floor() can accept a floating-point value and returns nearest smallest integer value. syntax: floor(floating-point-value) Query: select floor(9.6) from dual; 4) ceil(): --------- ceil() can accept a floating-point value and returns the nearest higher integer value. Syntax: ceil(float-value); Query: select ceil(9.5) from dual; 5) greatest(): -------------- salries {78000,100000,20000,77000,40000,50000,150000} greatest(salaries) ==> 150000 => greatest() can accept list of values and return the maximum value from the list. Syntax: greatest(list-of-values); 6) least(): ----------- => least() can accept list of values and returns the minimum value of the collection. Syntax: least(list-of-values); Ex: salaries {23000,18000,33000,55000,170000,59000} least(salaries) ==> 17000; Query: select least(23000,22500,55000,17000,18000,99000,150000) from dual; 7) mod(): --------- % ==> division a % b ==> remainder mod() ==> returns the remainder => mod() can accept two values returns the remainder by division operation Syntax: mod(v1, v2); 8) sqrt(): ---------- => sqrt() can accept a value and returns a square root of that value Syntax: sqrt(value); 9) power(): --------- => power() can accept two values and return a value as power of the specified values. Syntax: power(a, b); Here: result = a ^ b 10) log(): ---------- => to find the logarithm of any number, we can use "log()". Syntax: log(value, base); here: base ==> 10 or 2 Query: select log(10,10) from dual; select log(10,2) from dual; 11) sin() ==> to get the sin angle Syntax: sin(any-value) 12) cos() ==> to get the cos angle Syntax: cos(any-value) 13) tan() ==> to get the tan angel Syntax: tan(any-value) Date Handling Functions: ======================== 1) add_months(): ---------------- => add_months() can accept two values: 1) date ==> current date (sysdate) or any formatted date 'dd-Mon-YYYY' 2) number ==> number of months Syntax: add_months(date, number); => to the given date, the number in months can add and return the new date. Query: select add_months(sysdate, 12) from dual; select add_months('20-Jun-1993', 100) from dual; 2) last_day(): -------------- => last_day() can accept a date for that date's last day in the month can be returned. Syntax: last_day(date); Query: select last_day(sysdate) from dual; select last_day('19-Nov-2005') from dual; 3) next_day(): -------------- next_day() can accept two values: 1) date ==> from which date we need to get the next date 2) day ==> which day from the specified date we are expecting Syntax: next_day(date, day); Query: select next_day(sysdate, 'Saturday') from dual;