I am trying to model a database containing the following tables:
Meals (MealId)
MealRecipes (MealId, RecipeId)
MealFoods (MealId, FoodId)
Recipes (RecipeId)
RecipeFoods (RecipeId, FoodId)
Foods (FoodId)
A Recipe is composed of N Foods (Apple, Salmon, ...)
But when I build a Meal it can contain Recipes (Salmond with vegetables) but also a Food (Apple) ...
My biggest problem is with building the Meal with both Recipes and Foods.
UPDATE
One important thing is the order of the Recipes / Food in a Meal. So another approach would be:
Meals (MealId)
MealSteps (MealId, StepNumber, RecipeId, FoodId)
Where RecipeId or FoodId, either one, could be null. But not both.