Question: in Queries Start with the above Sub-Category Aggregate Query. Format all the number fields. Note that the FORMAT should always go on the outside of

  1. in Queries
    1. Start with the above Sub-Category Aggregate Query.
    2. Format all the number fields.
    3. Note that the FORMAT should always go on the "outside" of all other clauses. You are formatting the results of math and aggregates.
    4. You cannot perform math and aggregates on formatted fields because it converts the field to a text field and math won't work on a text field.
    5. Format the percentage field to show the correct formats (e.g., 19.23%, 19%) using the FORMAT clause (examples below). The percentage field should be properly formatted to zero decimal places.
      1. FORMAT(percentagefield, 'P3') as [ThreeDecimalsPercentage] -- 97.368%
      2. FORMAT(percentagefield, 'P0') as [WholeNumberPercentage] -- 97%
    6. Take Screen Shot
      1. Use the Snipping Tool to capture a screen shot of the entire SQL Server Management Studio window that includes the title bar, tool bar, left pane, query, query results, and right pane.
      2. MAKE SURE THE SCREEN SHOT INCLUDES ALL OF THE QUERY, THE TOP ROWS OF RESULTS (INCLUDING ROW COUNT), AND THE DATE AND TIME IN THE LOWER RIGHT HAND CORNER.
      3. Paste the screen shot in the Formatted Fields Query section of A03.docx
    7. Paste a copy of the final SQL Code in the Formatted Fields Query section of A03.docx
    8. Answer in Formatted Fields Query section of A03.docx. Add an order by the FORMATTED Markup Percentage field and manipulate it so that you can answer the following questions:
      1. What is the most profitable sub-category?
      2. What is the least profitable sub-category?
      3. What sub-category has the highest markup percentage?
      4. What sub-category has the smallest markup percentage?
      5. Are these answers different from those you got above in the Sub-Category Query when you sorted before formatting? What is different?
  2. In Discussion section of your MS Word document.
    1. Discuss why some kinds and types of Products do not show up in these queries.
    2. Why did you have to eliminate some rows to make this work and the answer is NOT that some rows had zero cost? From a business point of view what rows did not have costs?
  3. Graduate students: In Business Meaning section of your MS Word document named A03.docx.
    1. Discuss if we should sell products with a high profit or focus on selling those with a high markup percentage.
  4. After completing this assignment use the ERD, Data Dictionary, and your new understanding to complete the Assignment Quiz related to this Assignment. Be prepared to answer the following questions in that quiz.
    1. How did you have to limit the data in order to produce the Profit and Markup Percentage by Product query results?
    2. How many rows were retrieved in your Profit and Markup Percentage by Product query?
    3. How is Product Profit calculated?
    4. Which Product produces the most Profit?
    5. What is the Profit for the Product that produces the most Profit?
    6. What is the Markup Percentage of the Product that produces the most Profit?
    7. Which Product has the highest Markup Percentage?
    8. What is the Markup Percentage for the Product that has the highest Markup Percentage?
    9. How many SO-B909-M products would we have to sell to receive the same profit as a single unit of product BK-M82S-38?
    10. How is Product Markup Percentage calculated?
    11. Which product subcategory had the highest Markup Percentage?
    12. What is the product count for road bikes?
    13. What is the profit for socks?
    14. What is the profit for road bikes?
    15. How many rows in the product category query?
    16. Which category makes the most money?
    17. Which category has the highest markup percentage?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!