Reputation: 8016
Lets say I design a database model for an online seller such as Amazon:
Next, to create the database model for the larger data warehouse, I flatten the Order and OrderDetails tables, and flatten the Product and Vendor tables:
I do this to apply the concept of designing models for parent-child applications, as described here http://bit.ly/1bOuOXQ
The data in the data warehouse tables becomes repetitive:
Several values such as $76.30 for OrderTotal repeat on each row, is this correct? Is the model correct?
Upvotes: 1
Views: 1498
Reputation: 10193
Each row represents a match for each product, the corresponding order subtotal and total will be identical for each row with a specific orderid.
The result is as expected for your model definition.
Upvotes: 3
Reputation: 83205
Yes.
OrderTotal is the same for all records, so it is duplicated when you put everything in a single spreadsheet.
(Of course, in a relational database you are keep data in several tables, so it isn't duplicated.)
Upvotes: 1