Query List 6 to 7

 Query List

6. 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 to display Employee Name and Salary for all employees whose salary is not in the range of ₹15000 and ₹28500.

 Query: 

Select Ename, Salary from EMPLOYEE where Salary NOT BETWEEN 15000 AND 28500; 

Output: 

8. Query to display Employee Name and Department No of all the employees in Dept 101 and Dept 301 in the alphabetical order by name.

 Query 1: 

Select Ename, Dno from EMPLOYEE where Dno IN(101,301) ORDER BY Ename; 

Query 2: Select Ename, Dno from EMPLOYEE where DNO = 101 OR DNO = 301 ORDER BY Ename;

 Output:

9. Query to display Name and Hire Date of every Employee who was hired in 1981. 

 Query 1: 

Select Ename, Hire_date from EMPLOYEE where Hire_date BETWEEN '31-DEC-1980' AND '1-JAN-1982'; 

Query 2:

 Select Ename, Hire_date from EMPLOYEE where Hire_date LIKE '%81'; 

Query 3: 

Select Ename, Hire_date from EMPLOYEE where TO_CHAR(Hire_date, 'YY') = '81'; 

Output:

10. Query to display Name and Job of all employees who don’t have a current Manager. 

 Query: 

Select Ename, Job_type from EMPLOYEE where Manager IS NULL; 

output: 












Post a Comment

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