Query List 16 to 20

1 min read

 Query List

16. Query to display Name, Hire Date and Salary Review Date which is the 1st Monday after six months of employment.

 Query: 

Select Ename, Hire_date, Salary, TO_CHAR(NEXT_DAY(ADD_MONTHS(Hire_date,6),'MONDAY')) REVIEW from EMPLOYEE; 

Output:


17. Query to display Name and calculate the number of months between today and the date each employee was hired.

Query: 

Select Ename, months_between(sysdate, hire_date) "Months" from Employee;

 Output:  


18. Query to display the following for each employee:- earns monthly but wants < 3 * Current Salary >. Label the Column as Dream Salary.

 Query:

 Select Ename||' earns '||TO_CHAR(Salary)||' monthly but wants '||TO_CHAR(Salary*3)||'.' "Dream Salaries" from EMPLOYEE; 

Output:


19. Query to display Name with the 1st letter capitalized and all other letter lower case and length of their name of all the employees whose name starts with ‘J’, ’A’ and ‘M’.

Query: 

Select INITCAP(Ename) Ename, LENGTH(Ename) LENGTH FROM EMPLOYEE where Ename like 'J%' OR Ename like 'A%' OR Ename like 'M%'; 

Output:   

20. Query to display Name, Hire Date and Day of the week on which the employee started. '

Query:

 Select Ename, Hire_date, TO_CHAR(Hire_date,'DAY') from EMPLOYEE; 

Output: 












You may like these posts

  • Query List31. Query to display the Department Name, Location Name, No. of Employees and the average salary for all employees in that department.  Query 1: Select Dn…
  • Query List21. Query to display Name, Department Name and Department No for all the employees. Query: Select EMPLOYEE.Ename, DEPARTMENT.Dname, EMPLOYEE.Dno from EMPLOYEE …
  •  Query List16. Query to display Name, Hire Date and Salary Review Date which is the 1st Monday after six months of employment. Query: Select Ename, Hire_date, Salar…
  •  Query List6. Query to display Employee Name and Department Number for the Employee No = E90. Query: Select Ename, Dno from EMPLOYEE where Eno='E90'; Output:7.…
  •  Query List11. Query to display the Name, Salary and Commission for all the employees who earn commission. Sort the data in descending order of Salary and Commission. Q…
  • Query List26. Query to display Name, Dept No. and Salary of any employee whose department No. and Salary match both the department no. and the salary of any employee who earns a …

Post a Comment

© 2025DBMS. The Best Codder All rights reserved. Distributed by