select sysdate //your system date from dual 10-Apr-2020 //Add Months fucntion select add_months( sysdate , 3 ) //The number of months that you want to add from dual 10-Jul-2020 select add_months(hire_date, 5) //17-nov-1985 from employees //17-apr-1986 select round((sysdate - hire_date)/12) "The number of months" from employees //Months between function select round(months_between( sysdate , hire_date )) "The number of months" from employees //Next day function Next_day( sysdate , ' friday ' ) from dual 17-apr-2020 it will give you the date of the next day represented in the second parameter Next_day( sysdate , 'Tuesday' ) next_day(hire_date , 'Sunday') select next_day(sysdate,'Tuesday') from dual 14-Apr-2020 //Last day function will give you the date of the last day in the month employee = 13-sep-1990 => hire_date => 31-sep-1990 select last_day(hire_date) from employees select last_day(sysdate) from dual 30-Apr-2020 //Extract function you can extract a specific information from the date and display it on screen select extract(day from sysdate) from dual //10 select extract(month from sysdate) from dual //4 select extract(year from sysdate) from dual //2020 // Round and Trunc Functions number .5 => to next number => 7.5 => 8 => round number .5 => to next number => 7.5 => 7.5 => Trunc number .3 => to next number => 7.3 => 7 => round number .3 => to next number => 7.3 => 7 => Trunc 02:55 pm select round(sysdate) from dual 10-Apr-2020 12:00 am 0-9 round(sysdate, "year") 12 => 6 .. 7 > 6 17-jul-2020 => 01-jan-2021 10-apr-2010 1-jan-2010 round(sysdate, "month") 30 => 15 .. 15 >= 15-jul-2010 01-Aug-2010 10-jul-2010 1-jul-2010 round(sysdate, "day") 24 == 12 pm 14-jun-2020 10:00 am => 14-jun-2020 12:00 am 17-jul-2010 2:30 pm 18-jul-2010 //Formats for the year YYYY,YYY,YY,Y: Four-digit year. Last 3,2,1 digits in the year 2020,020,20,0 Year = two thousand and twenty //Formats for the months MM = 04, 01-09, 10-11-12 Month = April Mon = Apr //Format of the day DDD => 365 = 10-apr = 174 //The position of the day in the year DD => 30 = 10-apr = 10 //The position of the day in the month Day => Friday Dy => Fri FM to eliminate the blanks in the strings related to the date FMDay Friday //To_char function //is to convert a date to a string datatye (Varchar2) Hire_date and sysdate (Date) First_name, last_name (Varchar2) = String select to_char(sysdate, 'yyyy-mon-dy') fmt from dual 2020-Apr-Fri (Varchar2) = string //Diplay the system date with everything spelled out select to_char(sysdate, 'DDSP "Of" Month Year') from dual Tenth of april two thousand and twenty Table Student Social_sec_No (Varchar2) => string '4563' = string select to_number(Social_sec_No) from student 4563 => Number => int,float,double //To_date function converts strings to date according to a specific format select to_date('95-05-240', 'yy-mm-ddd') from dual '95-05-240' => String => 95-05-240 Date yy-mm-ddd select sysdate from dual 10-Apr-2020