Case Scenario: Designing Objects That Retrieve Data

The end of the fiscal year is coming, so the board of directors of Tailspin Toys needs to review the health and performance of the company throughout the year. They asked you to provide them with aggregated annual sales and expense data for the main factory. However, after you provided them with that information, they realized that they also needed information for the other factories, located in China, Costa Rica, and India. Based on the preliminary analysis that board members did, they realized that they also need to filter the information by territory and by date so that they can analyze and compare the data from different time perspectives—by halves, by quarters, and by individual months.

After discovering certain worrying flags in the numbers, the board of directors discovered that the sales for the factory in China were not as expected during the second quarter of the year. To understand the status of the situation fully, they decided to focus on specific product sales and combine that information with different factors that might have affected sales, such as external providers, the number of new employees hired, the number of employees leaving the company during the specific period, and the inventories of other factories for the same products.

  1. To accomplish your first task—providing the board with aggregated annual sales and expense data for the main factory—you decided to use an indexed view. Why?
  2. Describe the overall steps you took to provide the board with the sales and expense information it needed for all the other factories located in China, Costa Rica, and India.
  3. To allow the board members to filter the information by territory and by date, what type of object would you use to retrieve this data and why?
  4. To enable the board members to focus on specific product sales and combine that information with other factors such as external providers, the number of new employees hired, and so on, you decided to implement a table-valued UDF instead of using a stored procedure. Why?

< Back      Next >

 

 

© Microsoft. All Rights Reserved.