I have this problem, which seems like it should have an easy solution, but I can't figure it out.
Say we have
pizza_toppings table where a chef enters available sets of toppings. There are four toppings:
basil. The chef makes four different pizzas with the above ingredients:
pizza_toppings -------------- pizza 1 has only pepperoni pizza 2 has pepperoni and olives pizza 3 has olives or basil pizza 4 has ( pepperoni and pepper) or only basil
How would I record all these 'and', 'or', 'and + or', 'and + and', '(and + or) + and ...', etc. relationships between table entries?
It seems like a problem from some difficult textbook that should have a clever solution, which I can't figure out. My program doesn't actually deal with pizza and there will be countless "toppings" created by users and infinite possible combinations, which will also be combined by users. So I can't really make a table with pre-defined combinations. Is there a solution to such a problem?