How to model a relationship between Sandwiches and Toppings? I want to create a database structure pertaining to my product, which is a sandwich that can have one bread and many toppings.

To illustrate the problem I created a quick diagram:



For the one bread I can easily assign the sandwich_id as seen in the picture, but how would I assign the many toppings in a beautiful way?

My current considerations

I could think of some ideas:

topping_1_id, etc... and a toppings index as in 1 is ‘cheese’, 5 is ‘onion’, so topping_id = 15, but I am not sure how to do that.
Assuming you have your toppings and sandwiches tables, I'd create a linking table consisting of sandwich_id and topping_id, so that you can JOIN from each sandwich record to its many toppings and vice versa.

Each link represents a particular sandwich having a particular topping.

Hope that makes sense.