Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write a SQL Query to return the average of the salaries of employees in the o

ID: 3738641 • Letter: 1

Question

1. Write a SQL Query to return the average of the salaries of employees in the organization

2. Write the SQL query to round the answer you got in question #1 above to 4 decimal places

3. Write the SQL query to return the sum of the salaries of employees in the organization. As part of your SQL query, change the name of the column header in your output report to exactly like: Total Salary

4. Write the SQL query to return the count of employees working in each department:

5. Write the SQL query to find sum of salaries for each of the job ids (JOB_ID) in each of the departments (DEPT_ID). Ensure the output report is sorted by Departments:

6. Create an SQL statement that will display the maximum salary of each of the departments from the EMPLOYEES table. Group the output by department. In the display, we only want to see those department salaries where the maximum salary is over 10000. Your report output should look like:

7. Create an SQL statement that displays a report containing departments, the job ids, and sums of the salaries from the EMPLOYEES table. We only want to see those departments with a department id greater than 40. The output should be grouped by the department id and then the job id and the output order should be by department id. Moreover, we only want those SUM(SALARY) values that are over (greater than) 30000

DEPARTMENT IDMAX(SALARY) 12008 11000 24000 13000 12008 14000 100 30 90 20 110 80 2 4

Explanation / Answer

Answer)

Tables should have been provided for the problems.

1. Write a SQL Query to return the average of the salaries of employees in the organization.

Let we have table Employee and we have salary column in that for each of the employee.

SELECT AVG(salary) FROM Employee;

2. Write the SQL query to round the answer you got in question #1 above to 4 decimal places

SELECT ROUND(AVG(salary),4) FROM Employee;

3. Write the SQL query to return the sum of the salaries of employees in the organization. As part of your SQL query, change the name of the column header in your output report to exactly like: Total Salary

SELECT SUM(salary) as 'Total Salary' FROM Employee;

Let we have table Employee and we have salary column in that for each of the employee.

4. Write the SQL query to return the count of employees working in each department:

Let we have table Employee and we have department column in that for each of the employee, employee_ID id the primary key for the employees table.

select count(employee_ID) from Employee group by department;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote