# MIS 610 Topic 3 UNIONS and Subqueries

The purpose of this assignment is to practice UNIONS and to use subqueries to analyze data in a recordset.

For this assignment, you will analyze data to find similarities and UNION all data via a method that keeps the data uniform. 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

As part of a yearly fundraising effort for the community, your manager has given you an Excel worksheet titled “Donations.” It includes all employees’ pledged donations for the year. The sheet consists of three tabs that correspond to the 3 months when employees were asked to submit pledges. Load this file into the AdventureWorks database through the Import and Export Wizard. Once loaded, use a UNION ALL statement to combine the three data sets into a temporary table called “#TotalDonations.”

Problem Two

Redoing the UNION ALL statement you created in Problem One, create a temporary table looking exclusively at “SUM of Donations by Month.” Title each of the three fields “Donations and Month” with the temporary table titled “#DonationsbyMonth.” When complete, provide the total of the final amount of donations raised.

Problem Three

Your manager e-mails you about the final results you provided in Problem Three, and believes you must have made a mistake when calculating the total donations. The amount is \$100.00 less than the total amount calculated by the manager. The manager thinks it is possible that one employee might have accidently pledged \$100.00 twice. Explain how this event might occur with a UNION ALL. Review the UNION ALL, and if there is an error, rewrite the first query with a UNION statement. Discuss whether the manager’s assumption was correct and explain why.

Problem Four

You receive an e-mail request from Human Resources requesting information about the last time a pay rate was changed for an employee. The employee’s “NationalIDNumber” is 486228782. Develop a subquery instead of an INNER JOIN to provide the answer to this request.

Note: A subquery is another method of writing a JOIN. It can be efficient when used at the correct times.

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.

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our Guarantees

### Money-back Guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism Guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision Policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.