Download presentation
Presentation is loading. Please wait.
1
Assignment 2 Due Thursday Feb 9, 2006
The Star Schema to build OrderDate Employee OrderFacts RequiredDate quantity regularPrice discountedPrice discount Product ShippedDate Customer Order (DD) Feb 2006 Ron McFadyen
2
Assignment 2 Due Thursday Feb 9, 2006
Suggestions: Build each dimension in a separate task or package. A package can execute other packages. Use workflow to control the execution of tasks/packages. Once dimensions are constructed, then build the fact table. Consider using a View that returns exactly the data you want to become rows in the fact table. Such a View can be referenced in a Select that is used in an Insert. Consider constructing OrderFacts in two steps. The first step inserts rows. The second completes rows that have some missing values, such as date foreign keys. After you’ve inserted all your data you should do some data integrity checks: Do you have the correct number of rows in your tables? Required: Each dimension must have a surrogate key as its primary key. Set the PK for the fact table and establish each FK reference. Feb 2006 Ron McFadyen
3
Assignment 2 Due Thursday Feb 9, 2006
Create a star schema database. Use DTS to create Date and Employee dimensions to complement your Product and Customer dimensions (use Northwind as your source). Details: Create a fact table with metrics (from Order Details): quantity, regularPrice=unitPrice*quantity, discountedPrice=unitPrice*quantity*(1-discount), discount=regularPrice-discountedPrice Make order ID a degenerate dimension Ignore Shippers and the Reports To relationship in Employees. Note that Date must have a “n/a” row (and this will be needed for some fact rows) Write queries to show: How many orders have not been shipped? Calculate for each employee, the value (discountedPrice) of the orders they have handled, and list the values and employees names in order of decreasing order values How many orders were shipped > 10 days after the required date? “ <=10 days after the required date? Hand in your database name, package name(s), passwords for packages, and the printed output for queries including SQL. Feb 2006 Ron McFadyen
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.