Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I have a problem with circular references does anyone have an idea or suggestion for it?
The Purchase Order Header and the Purchase Order Detail tables could be combined into a single Fact table to be the centre of a Star Schema.
The Customer and Customer Group tables could also be combined into a single Dimension Table.
As Gysbert suggested you could ignore the Customer Product table, so the Product table becomes another Dimension table.
Thus leaving a simple Star Schema with one Fact table and 2 Dimension tables.
You should rethink your data model. There should be only one path from a table to any other table. A Star schema is ideal, limited snowflaking isn't a problem. You also have to consider the synthetic keys. They point out problems with your data model. Try to get rid of them. Perhaps you need a link table with all the key fields and create new key fields to link the tables with the link table. Perhaps this blog post helps explain this concept: Concatenate vs Link Table
So the relationship that should create the link tables table?
These are the tables that I have in the database
I think I'd get rid of the CustomerProduct table. In your first screenshot there seems to be only one field p_sku_cliente in that table besides the key fields. If you don't use this field for any analysis thenyou don't need the CustomerProduct table. If you do need it for analysis you can probably use a mapping table and the applymap function to add it to the PurchaseOrderDetail table.
The Purchase Order Header and the Purchase Order Detail tables could be combined into a single Fact table to be the centre of a Star Schema.
The Customer and Customer Group tables could also be combined into a single Dimension Table.
As Gysbert suggested you could ignore the Customer Product table, so the Product table becomes another Dimension table.
Thus leaving a simple Star Schema with one Fact table and 2 Dimension tables.