If you have the following tables and relations:
- A Product table
- A Price Point table (one or more prices for a product)
- A Version table (groups of products sold in the same area)
and the constraint that only one product price can exist in any given version. How would you construct the tables to reflect the constraints?
To illustrate the restriction, I have a product priced at $1, $2, and $3. I have media zones of A, B, C, D, E, F, G, H, I (each representing a place like Columbus OH)
product A price $1 goes to A, B, C
product A price $2 goes to D, E, F
product A price $3 goes to G, H, I
Product A price $1 when it exists in A, B, C cannot have other prices ($2, $3) in A, B, C
Would a Version M2M table to PricePoints, then put a unique index on the M2M table on all fields minus the PricePoint field work? (thought about it while typing this out) Is there a better way to represent the relationships?