Question

Lets say I design a database model for an online seller such as Amazon:

enter image description here

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:

enter image description here

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:

enter image description here

Several values such as $76.30 for OrderTotal repeat on each row, is this correct? Is the model correct?

Was it helpful?

Solution

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.

OTHER TIPS

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.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top