Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

--Homework #2 Query from A Single Table /*-------------------------------------------------------------------------------------- Instructions: You will need to import the data for Chicago Salary in order to complete this assignment.

--Homework #2 Query from A Single Table

/*-------------------------------------------------------------------------------------- Instructions:

You will need to import the data for Chicago Salary in order to complete this assignment.

The Chicago Salary tabe should be called dbo.ChicagoSalary and have 4 fields Name varchar(255) PositionTitle varchar(255) Department varchar(255) Salary decimal(19,2)

You should have a total of 32,432 rows.

Don't forget to name your columns, an output of (No column name) will reduce your overall grade.

Answer each question as best as possible. Show your work if you need to take multiple step to answer a problem. Partial answers will count. --------------------------------------------------------------------------------------*/

/* Q1. (0.5 point) Write the query to COUNT the number of Records in the Salary table.

*/

/* Q1. Query*/

/* Q2. (0.5 point) Write a query to display the number of unique names.

*/

/* Q2. Query */

/* Q3. (0.5 point) Write a query to display the only the name and position title of those with a full name that contains the text 'Spangler' in it.

*/

/* Q3. Query*/

/* Q4. (0.5 point) Write a query to display the name and position of the person who has the lowest Salary in the the AVIATION department.

*/

/* Q4. Query */

/* Q5. (0.5 point) Write a query to display all the names and salaries of everyone in the WATER MGMNT department that makes more than 150K in salary, order the output by Salary descending.

*/

/* Q5. Query */

/* Q6. (0.5 point) Display the total salary of the entire Chicago salary table.

*/

/* Q6. Query */

/* Q7. (0.5 point) Display the department name and average salary where average salary for the department is more than 90000.

*/

/* Q7. Query */

/* Q8. (0.5 point) Which Employee has the highest salary? How Much higher is that person's salary compared to the AVG salary of the department they belong to? You can use multiple queries to answer this question.

*/

/*Q8. Query */

/* Q9. (0.5 point) Display the Name, Department, Salary (to the nearest whole number) of any employee who has a salary of 60000 or more and their name begins with 'Aaron'.

*/

/* Q9. Query */

/* Q10. (0.5 point) Display LastName and FirstName (with Middle Initial) as seperate columns/fields derived from the Name field. Write down your query in the answersheet.

*/

/* Q10. Query*/

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Understand the role of internal marketing and communications.

Answered: 1 week ago