You'd want a table beverage_types with columns type_id
, name
so you don't end up with products name "Coke", "coke" and "COKE".
Also a table sizes with columns size_id
, description
, size
.
Finally that gives you a table beverage
with columns id
,type_id
,size_id
with FKs on type_id
and size_id
.
Now you just enforce one price per size per type with a UNIQUE INDEX
.
CREATE UNIQUE INDEX size_price_idx ON beverage (type_id,size_id);