You are on page 1of 3

Case Project Home Warranty Corporation (HWC)

Dim_Customer
CustomerKey CustomerID Customer_Name Customer_Address Customer_Phone

Service_Costs_Fact Dim_Part
PartKey PartID Part_Desc Part_Cost_per_Unit Part_Quantity
CustomerKey EmployeeKey PartKey DateKey ApplianceKey Employee_Cost Parts_Cost Total_Cost

Dim_Appliance
ApplianceKey ApplianceID Appliance_Manufacturer Appliance_Description Appliance_SerialNumber

Dim_Date
DateKey DateID DateofOrder WeekDay Week Quarter Year Season

Dim_Employee
EmployeeKey EmployeeID Employee_Name Employee_Wage Employee_WorkedHrs

Create database HWC; Go Use HWC;

Create Table Dim_Employee ( EmployeeKey Int Primary Key, EmployeeID Int, Employee_Name varchar(30), Employee_Wage Int, Employee_WorkedHrs Int ); Create Table Dim_Customer ( CustomerKey Int Primary Key, CustomerID Int, Customer_Name varchar(30), Customer_Address varchar(30), Customer_Phone varchar(30) ); Create Table Dim_Date ( DateKey Int Primary Key, DateID Int, DateofOrder Int, [WeekDay] varchar(30), [Week] Int, [Quarter] Int, [Year] Int, Season varchar(30) ); Create Table Dim_Part ( PartKey Int Primary Key, PartID Int, Part_Desc varchar (30), Part_Cost_per_Unit Int, Part_Quantity Int ); Create Table Dim_Appliance ( ApplianceKey Int Primary Key, ApplianceID Int, Appliance_Manufacturer varchar(30), Appliance_Description varchar(30), Appliance_SerialNumber varchar(30)

); Create Table Service_Costs_Fact ( CustomerKey Int not null, EmployeeKey Int not null, PartKey Int not null, DateKey Int not null, ApplianceKey Int not null, Employee_Cost Int not null, Parts_Cost Int not null, Total_Cost Int not null, Constraint FK_CustomerKey Foreign Key (CustomerKey) References Dim_Customer(CustomerKey), Constraint FK_EmployeeKey Foreign Key (EmployeeKey) References Dim_Employee(EmployeeKey), Constraint FK_PartKey Foreign Key (PartKey) References Dim_Part(PartKey), Constraint FK_DateKey Foreign Key (DateKey) References Dim_Date(DateKey), Constraint FK_ApplianceKey Foreign Key (ApplianceKey) References Dim_Appliance(ApplianceKey) );