Query List 11 to 15

1 min read

 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; 












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 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…
  • 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 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.…

Post a Comment

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