Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2011
    Posts
    6

    Warehouse - design problem

    Sales_fact:
    Product_ID (FK)
    Price

    Dim_Product:
    Product_ID
    Product_Key
    Description

    Problem I am facing with is what to do in case when I have products which can be in multiple categories. Should I just repeat record in Dim_Product for each category?

    Example:

    Fact table:
    Product_ID (FK): 1
    Price: 10.5

    Dim_Product:
    Product_ID:1
    Product_Key: ABC
    Description: Laptop
    Category_ID: 1

    Product_ID:1
    Product_Key: ABC
    Description: Laptop
    Category_ID: 2

    Dim_Category:
    Category_ID (FK): 1
    Description: HP

    Category_ID (FK): 2
    Description: Toshiba


    Thanks,
    Ilija

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    This is not a data warehouse. This is a data mart.
    If you want a data warehouse, follow Inmon's model, not Kimball's.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jul 2011
    Posts
    6
    Quote Originally Posted by blindman View Post
    This is not a data warehouse. This is a data mart.
    If you want a data warehouse, follow Inmon's model, not Kimball's.
    Ok, then it's a data mart, I used wrong term. Do you know answer to my question?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Quote Originally Posted by ilija View Post
    Problem I am facing with is what to do in case when I have products which can be in multiple categories. Should I just repeat record in Dim_Product for each category?
    Depending on what you want your mart to show, the answer could be either yer or no. Once you figure out (or explain) what your mart is showing, we can probably help you.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Jul 2011
    Posts
    6
    Quote Originally Posted by Pat Phelan View Post
    Depending on what you want your mart to show, the answer could be either yer or no. Once you figure out (or explain) what your mart is showing, we can probably help you.

    -PatP
    Examples:
    - I would like to count all products in certain category:
    - Display all products from certain category
    - Display all products from all categories

    Thank you Pat!

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    For a simplified "splat" type datamart schema, you could just make product one dimension and category a completely separate sales dimension. This is great for an analytical schema like you've proposed, but would make no sense in a warehouse or an OLTP schema.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  7. #7
    Join Date
    Oct 2008
    Posts
    2
    hi. you should have all the dimension id inside the fact table. then connect their keys. this is not datawarehouse architecture.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •