PLEASE READ ATTACHMENT FIRST FOR DETAILED INSTRUCTIONS AND SCREENSHOTS. The

PLEASE READ ATTACHMENT FIRST FOR DETAILED INSTRUCTIONS AND SCREENSHOTS.

The details for this assignment are attached. Here are the basics:

Attachments:

· 2017_product_data_students-final.csv

· 2018_product_data_students-final.csv

· 2019_product_data_students-final.csv

· Candy_part_1_skeleton_for_students.SQL

Your company wants to merge its old product order data into a new data mart to facilitate analysis. You have been tasked with writing an ETL (extract, transform, and load) code sequence, and executing it on three years’ worth of order data. 

In this assignment, you will produce SQL code which scrubs and imports each of the three years’ worth of data, and produces an output file called stagingTable.

Along with these instructions, there is another document, ‘Additional Clarification on the Week 6 Candy Assignment’. Please read that document carefully.

 You should also read the ‘Data Notes’ in part 3 of this document. It is very important that you understand the data and how the data changes over the three years, so you can create a ‘stagingTable’ the effectively combines the data that might have been captured in different ways over the years.

Let’s get started!

Part A: Upload all the files you will need to SQLlite:

  

1. Import the file called “2017_product_data_students.csv” to SQLiteonline.com.  When you import it, give it the table name “pd2017” (no quotes) and set the column name to “First line.”

2. Import “2018_product_data_students.csv” as “pd2018”

3. Import “2019_product_data_students.csv” as “pd2019”

4. If you SELECT * FROM pd2017, you should see something like the below screenshot. Note you should see all three of the import tables on the left, and the pd2017 data should match what is shown as selected.

  

Part B: Extract and Transform your data

Your job is to use SQL to perform an ETL which will accomplish the following:  INSTRUCTIONS IN ATTACHMENT.

1. Start with the skeleton starter script we give you, attached to this assignment. Modify the CREATE TABLE command so the schema is as follows: SEE ATTACHMENT

2. Get the 2017 bit of the script working. SEE ATTACHMENT

3. Get the 2018 part of the script working. SEE ATTACHMENT

4. Get the 2019 part of the script working. SEE ATTACHMENT

5. The script will load it into one final table and call it stagingTable

6. Run the checksum script to verify you have the stagingTable calculated correctly.

7. Export your final output table under the name “XX_output_final.csv” where XX are your initials.  To export this, you can just use the Export button on the SQLlite menu (it’s right next to the Import button.)

You should do this all in SQLlite. You should not export to Excel and do your manipulations in Excel.

Part C: 2017 Data Notes

Your order 2017 data is contained in the attached file, “2017_product_data_students.csv” and you should have imported it as “pd2017.” A sample of this file’s type of data is contained below in Table 1 Sample of order data from 2017. (Note your file may or may not have the same data in it.)

Your field definitions follow:

· Month: integer, corresponds to the month of the sale. For example, 5 = May.

· Country: text, should all be USA. (All data in this exercise should be USA.)

· Region: text, represents the regions within the country.

· State: text, USPS state abbreviations. Each state is within one region.

· Product: text. This is the name of a packaged food product.

· Per-unit price: integer. This represents the per-unit price in cents; for example, 300 indicates that Orange Creepies sell for $3.00 per package. (For the purposes of this exercise, disregard all currency formatting and just use 300 to represent $3.00.)

· Quantity: integer. This represents how many items were in that particular order. The first order here was for 49 packages of Orange Creepies.

· Order Total: integer. This is the per-unit price x the quantity. The first line here indicates that 300 x 49 = 14700 (or $147.00) was the price of the first order.

Table 1 Sample of order data from 2017 – SEE ATTACHMENT

2018 Data Notes:

Your order 2018 data is contained in the attached file, “2018_product_data_students.csv”

A sample of this file’s data is contained below as Table 2 Sample of order data from 2018. (Note your file may or may not have the same data in it.)

Your field definitions follow:

· Month: integer, corresponds to the month of the sale. For example, 5 = May.

· Region: text, represents the regions within the country.

· Customer_ID: integer, represents the customer’s unique Customer ID number.

· Product: text. This is the name of a packaged food product. 

· Per-unit price: integer. This represents the per-unit price in cents; for example, 363 indicates that PearApple sells for $3.63  per package. (For the purposes of this exercise, you should disregard all currency formatting and just use 363 to represent $3.63.)

· Quantity_1: integer. This represents how many items were in the first shipment of that particular order. This year we had shipping problems, and could often not ship the entire order all at once. Orders were split into two shipments where necessary, and Quantity_1 reflects how many units were shipped first. (Assume all shipments were completed in the month listed, and that no shipments had the first shipment in one month and the second shipment in the subsequent month.) 

· Quantity_2: integer. This represents how many items were in the second shipment of that particular order. A 0 indicates a second shipment was not necessary. To get the total number of items shipped, you need to add Quantity_1 and Quantity_2.

· The first line here reflects that PearApple has a first shipment of 25 units, and a second shipment of 92 unit, all within the month of January, for a total of 25 + 92 = 117 units. 

Table 2 Sample of order data from 2018 – SEE ATTACHED

  

2019 Data Notes:

Your order 2019 data is contained in the attached file, “2019_product_data_students.csv.”

A sample of this file’s data is contained below as Table 3 Sample of order data from 2019. (Note your file may or may not have the same data in it.)

Your field definitions follow:

· Month: integer, corresponds to the month of the sale. For example, 5 = May.

· Country: text, represents the country of the customer. Should all be USA.

· Region: text, represents the regions within the country.

· State: USPS code for the 50 United States.

· Product: text. Same as previous years.

· Per-unit price: integer. This represents the per-unit price in cents; same as previous years.

· Quantity: This represents how many items were in that particular order. The first order here was for 95 packages of Only Pancakes.

· Order Subtotal: This represents the order subtotal, calculated as per-unit price x quantity. For example, the first order here reflects a per-unit price of 413 cents x 95 units, for a subtotal of 39,235 (or $392.35). 

· Quantity Discount: This represents the new policy (effective January 1, 2019) that all orders 90 units and over will automatically earn a 10% discount. An order of 89 units does not earn the discount; an order of 90 units does earn the discount. All order discounts have been rounded to the nearest penny, so you can assume this field has no decimals in it. In the data below, 

o Order 0, on the first line, of 95 Only Pancakes to Florida, did qualify for the Quantity Discount, because an order quantity of 95 exceeded the 90 threshold. The Quantity Discount has been computed as 3924, or 10% of 39235. In this case, the final order total would be 39,235 – 3,924 = 35,311 (or $353.11).

o Order 4, on the fifth line, of 31 Future Toasts to North Carolina, did not qualify for the Quantity Discount. Therefore, the Order total would simply be the Order subtotal.

Table 3 Sample of order data from 2019 – SEE ATTACHED

  

Part D: Check Your Own Work

1.  You can run the following SQL code on your staging table. There is nothing to turn in from this bit. It should yield the following first few rows:

Select region, yearint, monthInt, count(*) from stagingTable where monthInt = 5 group by region, yearInt, monthInt;

2. You can also run the following code to debug. You should get the following rows:

Select yearInt, monthInt, state, customer_id, product_name, orderTotal from stagingTable 

where product_name = ‘Big Waffle’ and monthint=4

order by product_name, yearInt, monthInt, state, customer_id, orderTotal;

  

Now that you’ve debugged your code, it’s time to get a checksum! Run the following code to get a checksum. The checksum will be a number. Put this checksum number on the top of your homework. See table below for help with your CHECKSUM result. 

select sum(yearInt * monthInt * orderTotal)%2341 as checksum from stagingTable;

3. Once you get the result of your CHECKSUM look at table below for ways to troubleshoot any issues with your ETL statements. SEE ATTACHMENT

TURN IN:

1. Your output file, called “XX_output_final.csv” where XX are your initials.

2. All the SQL code you used to execute this.

3. A document that contains

a. CHECKSUM: XXX where XXX is the checksum number produced. Put this in big font right on the top.

b. A one page outline of your ETL process. Which functions did you use, and what logic did you follow? This should be at the level that your boss, who has an MBA but not an IT/database background, can follow it. Do not use “computer-ese” here; use regular business English.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Target is a brick and mortar retail store that has

   Target is a brick and mortar retail store that has been working to be more involved in same day services. Before the pandemic, they introduced options for shoppers to drive up to pick up orders or to have orders delivered. But this service was slow to take off. When

Part 1: Write a list of: 15 Verbs and use

Part 1: Write a list of: 15 Verbs and use them correctly in a sentence. (make sure you underline the verb) 15 Adjectives and use them correctly in a sentence. (make sure you underline the adjective) 15 Nouns and use them in a sentence. (make sure you underline the noun) Part 2: Write

You are working with your project sponsor to decide on

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Palestinian-Israeli Conflict, 1948-present – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Competency Examine the principles and functions of healthcare operations management.

Competency Examine the principles and functions of healthcare operations management. Discuss the competencies and professional qualities of healthcare administrators and operations managers. Compare and contrast operations management challenges and or barriers that affect various healthcare delivery systems. Explain the role and impact of data analytics on decision making processes in

1- Go to the search engine, Google, and type in

1- Go to the search engine, Google, and type in the box: attachment theory + (pick a mental disorder). For example, you can type attachment theory + eating disorders / or depression. Search evidence-based articles and then describe the disorder from an attachment point of view.   Your post will be

The company is aware of a “performance expectations gap” in

The company is aware of a “performance expectations gap” in an area of concern to their stakeholders but they lack a clear understanding of the problem. You must define it clearly for them and explain why it needs to be addressed. You should be as precise as possible, with clear

Lesson 11 – Discussion: Additional Victims No unread replies.No replies.

  Lesson 11 – Discussion: Additional Victims No unread replies.No replies. Topic According to Welch, Wilhelm, and Johnson (2013), child abuse and neglect can be divided into six subcategories. Identify and discuss these categories. Submission Requirements In a minimum of 150 words, discuss Grading Criteria Review the grading rubric to

1. Consider the stock flying Kites. The mean of its

   1. Consider the stock flying Kites. The mean of its daily returns is 0% and the volatility of its daily returns is 2%. Consider an ATM (at-the-money) call option on this stock. The price of this call option is $100. The I-day 95%ile VaR$ of the call option is

Please read the Case-4.2 “The Home Improvement Project.” from Chapter

   Please read the Case-4.2 “The Home Improvement Project.” from Chapter 4 “Defining the Project” given in your textbook – Project Management: The Managerial Process 8th edition by Larson and Gray page no: 132 also refer to specific concepts you have learned from the chapter to support your answers.  Answer

use social psychology theory to explain what would lead someone

use social psychology theory to explain what would lead someone to confront the person who made the offensive comment or joke, when doing so may likely make them the target of the joke teller’s retaliation. __________________________________________________________________________________ When reflecting on this discussion prompt, the first memory that came to mind was

ORGANIZATION DYNAMICS AND BEHAVIOR – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Martha Of the North (Fictional legal case on Grise Fiord and Resolute Bay)

Final Project: fictional legal case on Grise Fiord and Resolute Bay You will watch the documentary movie Martha of the North (dir. Marquise Lepage, 2008) on the State-organized “displacement” / “deportation” of Inuit families in inhabited lands north of the Arctic Circle. You will imagine that descendants of the family

1. Describe the role of the governing board in a healthcare facility. Include the relationship of the board to the medical staff and to the chief executive officer (administrator). Does this structure Nursing Assignment Help

1. Describe the role of the governing board in a healthcare facility. Include the relationship of the board to the medical staff and to the chief executive officer (administrator). Does this structure appear to be an effective one? 2. What is the purpose of medical staff bylaws? Is a hospital required to

Part 1. What is an ethical dilemma that your systems

Part 1.  What is an ethical dilemma that your systems analysis and design project in this course can solve?  Using thorough Biblical support, write a detailed purpose statement that clearly articulates how your system problem solves an ethical dilemma. Part 2.  Embed at least two unique class diagrams as a

Reply to: A couple eating disorders are anorexia and binge-eating.

Reply to:   A couple eating disorders are anorexia and binge-eating. Anorexia is the eating disorder of being extremely thin and extreme weight loss (Comer & Comer, 2021). Diets can start this disorder to form while traumatic events could cause the disorder to show, and the treatments would be cognitive

· Use the information presented in the module folder along

   · Use the information presented in the module folder along with your readings from the textbook to answer the following questions.  What are the different      portals of entry for a pathogen to enter the body?  2. Define the following disease categories: 1. Endemic – 2. Sporadic – 3. Epidemic

UA Culture and Emotions Questions Nursing Assignment Help

I’m working on a health & medical discussion question and need the explanation and answer to help me learn. What cultural ideas and practices related to emotion were you exposed to when you were a child? What cultural ideas and practices related to emotion are you currently exposed to as