For this assignment, continue to assume the role of data analyst at Adventure Works Cycling Company. As you work to address the business problem surrounding sales of the “LL Road Frame-Black 60,” you must continue to refine the data by condensing them into two tables. This requires you to join the table data sets together. While this is an important process, you must be aware of the data integrity issues that can occur as a result of completing joins.
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 Microsoft Word document that includes the SQL query code used to explore the database tables and answer the following questions.
Complete the steps below to practice joins.
- Combine MyProduct and MyPriceHistory displaying the fields into a new temporary table called MyProductPriceHistory. Display ProductID, Name, EndDate, and List Price.
- Combine MyProduct and MySalesOrderDetail displaying the fields into a new temporary table called MySalesOrderDetailbyName. Display ProductID, Name, SalesOrderID, and Quantity.
- Combine MySalesOrderDetailbyName and ALLSalesOrderDates displaying the fields into a new temporary table called MySalesOrderDetailbyDate. Display ProductID, Name, OrderDate, and SumOfQuantity. This will require you using the SUM and GROUP BY statements.
Create a Word document that includes the SQL query code used for each of the joins listed. Additionally, identify and analyze the data integrity issues you encountered in SQL.
- Discuss bad queries and bad table data in your analysis.
- Explain the impact of the data integrity issues.
- Indicate what needs to be revised in the code.
- Discuss specifically what needs to be done to fix the data integrity issues created by the join. Please note that as part of your final project for the course you will be adding these new tables to the ERD you created in Topic 5.