Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1)Find the average salary for employees in the IT department (the department name will be 'IT'). Label this column as Avg Sal. Format the result

1)Find the average salary for employees in the IT department (the department name will be 'IT'). Label this column as "Avg Sal". Format the result to display in dollars using commas (for thousands) with 2 decimal places. Use the SQL/86 and SQL/92.

Use the tables in your schema. 2)Alter the previous query to print out the average salary for all departments, showing the department name. (Hint: use the "group by" clause - see p121 of text). Order the output by lowest to highest average salary (Hint: use the column alias). Write this using SQL/92 with USING. Include a report header of "Average Salaries Per Department". Clear the title after running the report so it doesn't appear in the next query.

3)Alter the previous query to only print out those departments that have an average salary greater than 10,000. This time order the results in based on average salary in descending sequence.

image text in transcribed

HR DEPARTMENTS department_id department_name manager_id location_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 EMPLOYEES employee_id first_name last_name email phone_number hire_date job_id salary commission_pct manager_id department_id COUNTRIES country_id country_name region_id JOBS job_id job_title min_salary max_salary REGIONS region_id region_name

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions