Query List 36 to 40

1 min read

Query List

36. Query to display the department no, name and job for all employees in the Sales department. 

 Query:

 Select e.Dno, e.Ename, e.Job_type from EMPLOYEE e, DEPARTMENT d where e.Dno=d.Dno AND d.Dname='Sales';

Output:

37. Create a query to display the Employee name and salary for all employees. Format the salary to be 15 characters long, left-padded with ₹. Label the column SALARY. 

 Query:

 SELECT ENAME, LPAD(SALARY,15,'₹') AS "SALARY" FROM EMPLOYEE; 

Output:


38. Display the Employee name, hire date, and day of the week on which the employee started. Label the column DAY. Order the results by the day of the week starting with Monday. 

Query: 

SELECT ENAME, HIRE_DATE, TO_CHAR(HIRE_DATE,'DAY') AS "DAY" FROM EMPLOYEE ORDER BY DAY ASC;

 Output:


39. List the employees in the ascending order of Designations of those, joined after the second half of 1981. 

 Query: 

Select * from employee where hire_date > ('30-jun-81') and to_char(hire_date,'YYYY') = 1981 order by job_type asc; 

Output:


40. List the employees who are either ‘CLERK’ or ‘ANALYST’ in the Desc order.

 Query: 

Select * from employee where job_type = ‘CLERK’ or job_type = ‘ANALYST’ order by job_type desc; 

 Output:













You may like these posts

  • 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 List36. Query to display the department no, name and job for all employees in the Sales department.  Query: Select e.Dno, e.Ename, e.Job_type from EMPLOYEE e,…
  • 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 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 …
  •  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…

Post a Comment

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