Query List 11 to 15

 Query List

11. 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.

 Query 1: (Sort data in descending order of salary)

 Select Ename, Salary, Commission From EMPLOYEE where Commission NOT IN (0.00) ORDER BY Salary DESC;

Query 2: (Sort data in descending order of Commission) 

 Select Ename, Salary, Commission From EMPLOYEE where Commission > 0.00 ORDER BY Commission DESC; 

Output:

12. Query to display Name of all the employees where the Second letter of their name is ‘a’. 

 Query: Select Ename from EMPLOYEE where Ename like '_a%'; 

Output: 

13. Query to display Name of all employees either have two ‘R’s or have two ‘A’s in their name and are either in Dept No = 301 or their Manger’s Employee No = E78. 

 Query:

 Select Ename from EMPLOYEE where Ename LIKE '%r%r%' OR Ename LIKE '%a%a%' AND (Dno=301 or Eno='E78'); 

Output:  

14. Query to display Name, Salary and Commission for all employees whose Commission Amount is greater than their Salary increased by 5%. 

 Query:

 Select Ename, salary, Commission from EMPLOYEE where Commission > (Salary + ((Salary * 5)/100));

 Output: 

15. Query to display the Current Date.

 Query:

o Select SYSDATE From dual; 

o Select TO_CHAR(SYSDATE,'YYYY-MM-DD') From dual;

o Select TO_CHAR(SYSDATE,'DL') From dual; 

o Select TO_CHAR(SYSDATE,'DL','NLS_DATE_LANGUAGE = HINDI') From dual; 












Post a Comment

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