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 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 List51. Display the Employee no, Ename, Salary, Dname, Location, Department no, Job of all employees working at Tokyo or working for ACCOUNTING department with Annual…
  • 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 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 List41. List the employees who joined on 25-JAN-81, 09-MAY-81, 05-NOV-81, 04- JUN-80 in asc order of seniority.  Query:Select * from employee where hire_date in ('2…
  •  Query List46. List all the employees who joined before or after 1981. Query: Select * from employee where to_char(hire_date,'YYYY') not in ('1981'); (OR)Select…

Post a Comment

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