Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this assignment is to examine the use of aggregate functions, analyze queries that contain NULL values, and use CASE logic to resolve

The purpose of this assignment is to examine the use of aggregate functions, analyze queries that contain NULL values, and use CASE logic to resolve the data and arrive at a solution.

For this assignment, you will perform a set of exercises in which you will analyze data and develop corresponding aggregate functions to obtain the required information. You will use Microsoft SQL Server 2016 Developer Edition and the content from the AdventureWorks 2016 and Scripts for SQL Server 2016 CTP3 to complete the assignment.

Please note that when SQL queries are run, results are generated in the form of data. This data should be exported and saved to Excel for a visual check of accuracy.

Create a Word document that includes the SQL queries used to explore the database tables, and answer the following questions.

Query Scenarios

Problem One

The sales manager asks you to provide the average "Pretax Sales" amount throughout the years. Using the "Sales.SalesOrderHeader" table, what answer will you provide to the sales manager?

Problem Two

As part of an internal competition, the CEO requests that you provide the name of the employee who made the highest total single sale in 2014. This data needs to include the filter "Tax & Freight" using "OrderDate" for the year. The CEO has also requested that you provide the winner's e-mail address so he can send a notification of congratulations.

Problem Three

Jo Berry's manager indicated that Jo was taking paid time off this month. He wants to ensure the system reflects this information. Import the "Hours" spreadsheet file into the AdventureWorks database. Add Jo Berry's hours together for the month, and title the field "Monthly Hours." Use the knowledge you have learned about NULL values to provide the solution to the manager.

Problem Four

The human resources manager wants to classify employees who were absent during the entire month as "Inactive." Using a CASE statement, write a query that classifies employees as "Active" or "Inactive" in a column titled "Status" with "Full Name" (First and Last) also listed.

Problem Five

Using the same parameters as Problem Four, rewrite the query to provide only the list of "Inactive" employees.

General Requirements

Compile the Excel data file and Word document containing the SQL queries and answers to the questions into a .zip file and submit to your instructor.

APA style is not required, but solid academic writing is expected.

This assignment uses a rubric. Please review the rubric prior to beginning the assignment to become familiar with the expectations for successful completion.

You are not required to submit this assignment to LopesWrite.

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

discuss the problem of compulsive sports gambling.

Answered: 1 week ago