RTRIM - Strings LTRIM Courses : Course_name varchar(10) ITEC212 ---------- ITEC212--- select rtrim(course_name) from courses ---ITEC212 select ltrim(course_name) from courses Example: in this example we tried to compare the length of the string before and after using RTRIM select department_name, length(department_name) "Before RTRIM", length(RTRIM(department_name)) "After RTRIM" from departments Number Functions: Round(number,position) - 7.5 = 8 , 7.3 = 7, 7.65 = 8 Trunc(number,position) - 7.5 = 7.5 , 7.3 = 7, 7.65 = 7.65 Mod(111,6) - 8%2 = 0 , 5%2 = 1 Example: 45.635489 - The decimal point represents position zero Round(45.635489,5) = 45.63549 Round(45.635489,0) = 46 Trunc(45.635489,5) = 45.63548 Trunc(45.635489,2) = 45.6 Round(45.635489,-1) = 46 Trunc(45.635489,-1) = 45 Trunc(44.635489,-1) = 40 Dual table: you can use this table when you're dealing with numbers that are not stroed in the databse, also you can use it to display the system information. Sysdate : will return the system date select sysdate //will display the system date from dual Operations with dates: select sysdate + 24 //will add 24 days to the system date from dual select sysdate - 5 //will display 29th from last month from dual Subtract two dates to find out the number of days between these dates Example: select first_name, hire_date "Started", round(sysdate - hire_date) "Duration" from employees // use dual table ONLY if you displaying system information ALONE without any information from other tables Example: Find out for how many years the employees have been hired in the company SELECT LAST_NAME, ROUND((SYSDATE-HIRE_DATE)/365) FROM EMPLOYEES Example 2: SELECT FIRST_NAME, HIRE_DATE, ROUND(SYSDATE-HIRE_DATE) "NUMBER OF DAYS", ROUND((SYSDATE-HIRE_DATE)/365) "NUMBER OF YEARS", ROUND((SYSDATE-HIRE_DATE)/12) "NUMBER OF MONTHS", ROUND((SYSDATE-HIRE_DATE)/7) "NUMBER OF WEEKS" FROM EMPLOYEES Date Functions: - sysdate - current_date select sysdate, current_date //somehow the same from dual - current_timestamp select CURRENT_TIMESTAMP from dual