Fact Table - PowerPoint PPT Presentation

About This Presentation
Title:

Fact Table

Description:

INTO Fact ... WHERE CustomerSurrogates.CustomerNumber= Fact.CustomerNumber; ALTER TABLE Fact DROP CustomerNumber; ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 6
Provided by: schw
Learn more at: https://www.ou.edu
Category:
Tags: fact | table

less

Transcript and Presenter's Notes

Title: Fact Table


1
Fact Table
2
FactCreate
  • SELECT Customer.CustomerNumber, Orders.OrderDate,
    OrderLine., SalesRep.SakesRepNumber
  • INTO Fact
  • FROM SalesRep INNER JOIN (Part INNER JOIN
    ((Customer INNER JOIN Orders ON
    Customer.CustomerNumber Orders.CustomerNumber)
    INNER JOIN OrderLine ON Orders.OrderNumber
    OrderLine.OrderNumber) ON Part.PartNumber
    OrderLine.PartNumber) ON SalesRep.SakesRepNumber
    Customer.SalesRepNumber

3
Add Surrogate Key Column
  • ALTER TABLE Fact ADD COLUMN CustomerKey NUMBER

4
Update Surrogate Key
  • UPDATE Fact, CustomerSurrogates
  • SET Fact.CustomerKey CustomerSurrogates.Customer
    Key
  • WHERE CustomerSurrogates.CustomerNumber
    Fact.CustomerNumber

5
  • ALTER TABLE Fact DROP CustomerNumber
Write a Comment
User Comments (0)
About PowerShow.com