0% found this document useful (0 votes)
74 views2 pages

SUBQUERY

This document contains 27 SQL queries related to employees and departments in a database: retrieving employee names by department ending or character, employees with maximum/minimum salaries, departments with most/least employees or highest commissions, employees by manager or location, and other comparisons of attributes between employees and departments. The queries retrieve and filter data based on job, salary, location, reporting structure, and other fields to analyze the employee and department data.

Uploaded by

Chinna Chanti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views2 pages

SUBQUERY

This document contains 27 SQL queries related to employees and departments in a database: retrieving employee names by department ending or character, employees with maximum/minimum salaries, departments with most/least employees or highest commissions, employees by manager or location, and other comparisons of attributes between employees and departments. The queries retrieve and filter data based on job, salary, location, reporting structure, and other fields to analyze the employee and department data.

Uploaded by

Chinna Chanti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

DISPLAY ALL THE EMPLOYEES WHOSE DEPARTMET NAMES ENDING 'S'

2.QUERY TO DISPLAY THE EMPLOYEE NAMES WHO IS HAVING MAXIMUM SALARY IN DEPT NAME
"ACCOUNTING"

3.QUERY TO DISPLAY THE DEPT NAME WHO IS HAVING HIGHEST COMMISSION

4. QUERY TO DISPLAY THE EMPLOYEE NAMES WHOSE DEPARTMENT NAME HAS 2ND CHARACTER AS
'O'.

5. QUERY TO DISPLAY ALL THE EMPLOYEES WHO�S DEPT NUMBER IS SAME AS SCOTT.

6.QUERY TO DISPLAY ALL THE EMPLOYEES IN 'OPERATIONS AND ACCOUNTING' DEPT.

7.LIST THE EMPLOYEES WHO HAS SALARY GREATER THAN MILLER

8. LIST DEPARTMENT NAME HAVING ATLEAST 3 SALESMAN

9. DISPLAY THE DNAME OF AN EMPLOYEES WHO HAS NO REPORTING MANAGER.

10. LIST ALL THE EMPLOYEES WHO ARE REPORTING TO JONES MANAGER

11. LIST EMPLOYEES FROM RESEARCH&ACCOUNTING HAVING ATLEAST 2 REPORTING.

12. DISPLAY THE DEPARTNAME OF THE EMPLOYEE WHOSE NAME DOES NOT STARTS WITH S AND
SALARY BETWEEN 1500 TO 3000.

13.DISPLAY LOCATION OF EMPLOYEE WHOSE SALARY IS MINIMUM SALARY BUT SALARY IS


GREATER THAN 2000

14. DISPLAY THE LOCATION OF AN EMPLOYEE IN ACCOUNTING DEPARTMENT.

15. DISPLAY THE DEPARTMENT �S LOCATION THAT IS HAVING GREATER THAN FOUR EMPLOYEES
IN IT.

16. WRITE A QUERY TO DISPLAY ALL THE EMPLOYEE WHOSE JOB NOT SAME AS ALLEN AND
SALARY IS GREATER THAN MARTIN.

17. DISPLAY ALL THE EMPLOYEES WHO IS HAVING LOCATION IS SAME AS ADAM'S MANAGER?
18. DISPLAY THE JOB, MANAGER NUMBER OF EMPLOYEES WHO IS WORKING FOR JONES?

19. DISPLAY THE EMPLOYEE NAMES, HIGHER DATE, COMMISSION OF FORD'S MANAGER?

20. DISPLAY THE NUMBER OF EMPLOYEES WHO ARE GETTING SALARY LESS THAN THE BLAKE'S
MANAGER

21. LIST EMPLOYEES WHO LOCATED IN CHICAGO AND THEIR COMMISSION IS ZERO.

22. LIST EMPLOYEES WHO WORK FOR SALES DEPARTMENT AND THEIR SALARY GREATER THAN
AVERAGE SALARY OF THEIR DEPARTMENT.

23. LIST EMPLOYEES WHO ARE WORKING IN RESEARCH DEPARTMENT AND THEY ARE MANAGER.

24. DISPLAY DEPARTMENT NAME OF THE EMPLOYEES WHO EARN COMMISSION.

25. DISPLAY DEPARTMENT NAME OF THE EMPLOYEE WHO EARN MAXIMUM SALARY AND HAVE NO
REPORTING MANAGER.

26. DISPLAY EMPLOYEE DETAILS WHO ARE REPORTING TO BLAKE AND HAVE COMMISSION WITHOUT
USING NULL OR NOT NULL

27. LIST ALL THE DEPTNAME AND LOC OF ALL THE SALESMAN MANAGER-MANAGER'S

You might also like