The document contains 25 queries to run on sample database tables:
1. Find employees whose commission is greater than their salary or 60% of their salary.
2. Find details of all managers in any department and clerks in department 20.
3. Find employees who do not receive commission.
4. Find different jobs of employees receiving commission.
5. Additional queries find employee names, department details, salaries, highest and lowest salaries by department, and more.
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
122 views
Set 1: Tables Emp, Dept, Salgrade
The document contains 25 queries to run on sample database tables:
1. Find employees whose commission is greater than their salary or 60% of their salary.
2. Find details of all managers in any department and clerks in department 20.
3. Find employees who do not receive commission.
4. Find different jobs of employees receiving commission.
5. Additional queries find employee names, department details, salaries, highest and lowest salaries by department, and more.
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1
Set 1: Tables Emp, Dept, salgrade
1. Query Emp table.
2. Find employees whose commission is greater than their salaries. 3. Find employees whose commission is greater than 60 % of their salaries. 4. Find the details of all the managers (in any dept) and clerks in dept 20. 5. Find the employees who do not receive commission. 6. Find the different jobs of employees receiving commission. 7. Find the employees who do not receive commission or whose commission is less than 100/-. 8. Find all the employees whose names are upto 15 character long and have letter R as 3rd character of their names. 9. Display the names of all the employees right aligning them to 15 characters. 10. Display the names of all the employees replacing A with a. 11. For each employee, display the no. of months passed since the employee joined the company. 12. Display the names of the employees, based on the tenure with the oldest employee coming first. 13. List the employee names, department names and hiredate for those employees who have joined in 2003 . Sort your output in the order of joining date. 14. Find the names of those employees who earn more than their boss. 15. Display highest, lowest, sum and average salary of all the employees. Round your result to whole numbers. 16. Display department name and average salary for that department. Include only those employees who have joined after 1st July 2001. 17. Find all the department details in which at least one employee is working. 18. Find all, who are bosses of least one employee. 19. Find average annual salary of all the employees except analysts. 20. Display name , hire date and salary of all the employees who have both salary and commission same as SCOTT. Do not include Scott in the list. 21. List employees who earn salary higher than the highest salary of clerks. 22. Display each deprtment name and the first employee who joined that department. 23. Display department name, grade, Max salary offered to each grade at each department. 24. Whos earning the best salary in each grade and where do they live? 25. Delete all duplicate records from STUDENT table.