Suppose I have a table with several price values in it
ID Int, Primary Key, not null
AveragePrice Decimal, not null
MinPrice Decimal, not null
MaxPrice Decimal, not null
Each price value can be known and present (represented as a positive value) or it can be
* infinite (without upper bound)
* unknown
* irrelevant
* customer specific
There may be more even states.
**How to model this in a database?**
Currently these states are modelled as negative constants, e. g. a price of -10 means "unknown", -20 means "irrelevant". Since prices are normally positive this kind of works but I hope there exists a more elegant solution.
Asked by TobiMcNamobi
(103 rep)
Apr 4, 2018, 07:35 AM
Last activity: Apr 4, 2018, 12:12 PM
Last activity: Apr 4, 2018, 12:12 PM