Query List 36 to 40

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:













Post a Comment

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