If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Warehouse - design problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-11, 05:52
ilija ilija is offline
Registered User
 
Join Date: Jul 2011
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 10-18-11, 09:33
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
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"
Reply With Quote
  #3 (permalink)  
Old 10-18-11, 09:42
ilija ilija is offline
Registered User
 
Join Date: Jul 2011
Posts: 5
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?
Reply With Quote
  #4 (permalink)  
Old 10-18-11, 12:34
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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.
Reply With Quote
  #5 (permalink)  
Old 10-19-11, 06:22
ilija ilija is offline
Registered User
 
Join Date: Jul 2011
Posts: 5
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!
Reply With Quote
  #6 (permalink)  
Old 10-20-11, 02:40
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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.
Reply With Quote
  #7 (permalink)  
Old 11-11-11, 02:09
yaqen yaqen is offline
Registered User
 
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.
Reply With Quote
Reply

Tags
schema, snowflake, warehouse

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On