You are on page 1of 2

Que 1. Display Hire date from employee table with 9 months increment.

Que 2. Display months between current date and your birthday.

Que 3. Display hire date with increment of 3 months of employees who is having department id
50,100.

Que 4. Execute following operations in single query and print output.

1. First name in Upper


2. Last name in lower
3. Email in initial cap
4. Hire date as Joining date
5. Salary plus 10000

Que 5. Print next day(Take MONDAY) of hire date from employees and print both columns with first
name.

Que 6. Replace commission value from null to 7.5 whose job id is SH CLERK.

Que 7. Remove 0 from department id whose department id is 110 and print their salary incremented
by 9000, first name is lower, hire date with 7 months addition.

Que. 8 print mod of salary with 500 .

Que 9. Print following as given in sentence.

1. The updated information of employee_name is, hire date is incremented by 6 months , null
value in commission is updated by 5.6.

Answers:

select first_name,hire_date,add_months(hire_date,9) from employees;

select floor(MONTHS_BETWEEN(Sysdate,'25-05-1997')) from dual;

select first_name,department_id,hire_date,add_months(hire_date,3) from employees where


department_id in(50,100);

select upper(first_name),lower(last_name),initcap(email),hire_date as
joining_date,salary+10000 from employees;

select first_name,hire_date,next_day(hire_date,'MONDAY') from employees;


select first_name,job_id,commission_pct,nvl(commission_pct,7.5) from employees where
job_id='SH_CLERK';

select lower(first_name),department_id,trim(trailing '0' from department_id),salary,salary+9000


as incremented,add_months(hire_date,7) from employees where department_id=110;

select salary,mod(salary,500) from employees;

select 'The updated information of '||first_name||' is '||'1) hire date is


'||add_months(hire_date,6)||' 2) Commission is '||nvl(COMMISSION_PCT,5.6)from employees;

You might also like