Purchase Solution

SQL statements and query

Not what you're looking for?

Ask Custom Question

(3.7) Write a SQL query that uses UNION of the two tables. Be creative.

Using the updated database, write the following queries using the SQL GROUP BY statement and appropriate aggregate statements (when needed):

(3.8) Write a SQL query that displays the average salary / hourly wage grouped by job_title.
(3.9) Write a SQL query that displays the number of people in each EE0-1 Classification and the average salary / hourly wage for each classification.
(3.10) Group employees by EEO classification: Select the employees' last names and group them by EEO-1 Classification
(3.11) Group employees by salary within their EEO classification: Select the employees' last names and group them by salary within their EEO-1 Classification.
(3.12) Select the employees' last names and group them by salary within job titles that are grouped into exempt and non-exempt.

Using the database and tables from Week Three, write queries to the specifications listed below.
(Note: Verify that the updates in the next three statements (4.1 - 4.3) are completed correctly by displaying the relevant columns before and after the updates run.)

(4.1) Choose an EEO-1 Classification: Increase all employees' salaries that have: the selected EEO-1 classification by 10%.
(4.2) Increase all employees' salaries by 5%.
(4.3) Choose an employee from the employee table; delete this employee.

Using the database and tables from Week Three, write SQL statements to:
(4.4) How many people are salaried and how many are hourly?
(4.5) Calculate the minimum salary for all salaried employees.
(4.6) Calculate the minimum hourly rate for all hourly employees.
(4.7) Calculate the average wage (salaried or hourly) for each EEO-1 Classification.
(4.8) Calculate the maximum salary for exempt employees and the maximum salary for non-exempt employees.
(4.9) Calculate the minimum salary for exempt employees and the maximum salary for non-exempt employees.

Purchase this Solution

Solution Summary

SQL statements and query are analyzed. The solution updates a database.

Solution Preview

3.7
SELECT Job_title, Wage FROM Employee
UNION ALL
SELECT Job_title, Exempt_Non_Exempt_Status FROM Job_title

3.8
SELECT Job_title, AVG(Wage)
FROM Employee
WHERE Wage BETWEEN 1.00 AND 25.00
GROUP BY Job_title

3.9
SELECT EEO_1_Classification, AVG(Wage), COUNT(Emp_id) as number_of_people
FROM Employee, Job_title
WHERE Employee.Job_title=Job_title.Job_title
GROUP BY EEO_1_Classification

3.10
SELECT Last_name, EEO_1_Classification
FROM Employee, Job_title
WHERE Employee.Job_title=Job_title.Job_title
ORDER BY EEO_1_Classification ...

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic Networking Questions

This quiz consists of some basic networking questions.

C# variables and classes

This quiz contains questions about C# classes and variables.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.