3
I’m modeling a database (MSSQL) and a question has arisen. In every business rule of the clients the data is visualized vertically ex:
- Product,
- Original Price,
- Concurrent Price 01,
- Concurrent Price 02,
- Concurrent Price 03,
- Concurrent Price 04,
- Concurrent Price 05
- Datareading
that is to define the 5 competitors straight away and at worst would have to add a new column for a new competitor.
But my knowledge in SQL says that I should normalize and put the data horizontally, even knowing that the chances of increasing a new competitor is tiny.
ex:
- Product
- Original Price
- Concurrent Price
- Competitor id;//1= competitor 01, 2=competitor 02, etc
- Datareading
By doing it in the traditional (standardised) way, I have already realised that I will have a lot of work to generate the reports as the customer wants, as several lines actually represent only one line for the report.
In SQL would have to make queries with PIVOT
Doubt:
What is the correct shape in this modeling? Following the business rule of client and then denormalize to facilitate or follow the rigid standards of normalization? This is a scenario that for me would be a denormalization advantage.
Competitors are always the same, for all products?
– José Diz
No, there are 5 separate competitors, each product is represented by 5 competitors.
– Dorathoto
@Dorathoto Have any answers solved what was in doubt? Do you need something else to be improved? Do you think it is possible to accept it now?
– Maniero
I’m still checking.....
– Dorathoto