如果一个store_id只属于一个company_id,你可以断开t_deal_history与t_company的连接,通过store_id可以间接对应到company_id和company_name,这样模型比较简单,也不会出现错误组合。
------------------------------------------------------------------发件人:[email protected]
 <[email protected]>发送时间:2017年9月21日(星期四) 11:54收件人:user <[email protected]>主 
题:how to avoid the combination of this situation: " Apple company have a Nike 
store"?

hi, Thanks for your reading this first!


1.here's my tables:
t_deal_history is the fact table that  recording  every bill of a store.t_store 
is the lookup tablet_company is the lookup  table, one company can have many 
stores in different place.


sample data for the tables:t_compay:company_idcompany_name1NIKE2Apple
t_store:
store_idstore_namecompany_id1Nike Flagship store12Nike Shoes store13Apple 
NewYork24Apple Tokyo2

t_deal_history:
deal_history_idstore_idcompany_idbill_money111100.00221100.00332100.00442100.00
kylin model design:

Did this can occur a cubeid which " Apple company have a Nike store"?how to 
avoid the combination of this situation?Or, change t_deal_history don't join 
with t_store instead of join with t_company directly,  is it possible?

What's the right relationship between these three tables? any ideas? 


Thanks a lot.

[email protected]

Attachment: InsertPic_.png
Description: Binary data

Attachment: InsertPic_961F.png
Description: Binary data

Attachment: InsertPic_DBD5.png
Description: Binary data

Attachment: InsertPic_50DA.png
Description: Binary data

Reply via email to