Question: Consider the above given schema and write down following SQL queries. 1. Display the highest, lowest, sum and average salary of all employees. Label the
Consider the above given schema and write down following SQL queries.

1. Display the highest, lowest, sum and average salary of all employees. Label the columns Maximum, Minimum, Sum and Average respectively. 2. Modify the first query to display the highest, lowest, sum and average salary for each job. 3. Modify the first query to display the highest, lowest, sum and average salary against each department. 4. Show all department Id whose average salary exceeds 5000. 5. Display all department Id whose total salary is in the range of 5000 to 50,000 6. Write a query to display the number of employees with the same job. 7. Display the manager id and the salary of the lowest and highest paid employee for that manager. 8. Display country id of countries in which total number of cities are 5 or more. 9. Display all job_id and job_title of all those jobs whose minimum salary is same. 10. Display region _id in which the total number of counties is greater than 5. NOTE : CMD PROPER CODE SCREEN SHOTS
REGIONS REGION ID REGION_NAME DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID + LOCATION_ID COUNTRIES COUNTRY_ID COUNTRY_NAME FREGION_ID JOBS JOB_ID JOB_TITLE MIN SALARY MAX_SALARY EMPLOYEES EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB ID SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID LOCATIONS LOCATION_ID STREET_ADDRESS POSTAL_CODE CITY STATE_PROVINCE -COUNTRY_ID JOB_HISTORY EMPLOYEE_ID START-DATE END DATE -JOB_ID DEPARTMENT_ID 7.1. Practice Task 1 [Expected time = 40mins] Consider the above given schema and write down following SQL queries. 1. Display the highest, lowest, sum and average salary of all employees. Label the columns Maximum, Minimum, Sum and Average respectively. 2. Modify the first query to display the highest, lowest, sum and average salary for each job. 3. Modify the first query to display the highest, lowest, sum and average salary against each department. 4. Show all department Id whose average salary exceeds 5000. 5. Display all department Id whose total salary is in the range of 5000 to 50,000 6. Write a query to display the number of employees with the same job. 7. Display the manager id and the salary of the lowest and highest paid employee for that manager. 8. Display country id of countries in which total number of cities are 5 or more. 9. Display all job_id and job_title of all those jobs whose minimum salary is same. 10. Display region_id in which the total number of counties is greater than 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
