Pardon the brevity but: I am currently working on a project which requires users to create a 12 week diet/exercise regime. I basically need to store 3 meal options for each day which can be made up of multiple different food items. I would appreciate any advice or suggestions - thanks
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I will be brief as well:
You need a table for each of the following:
Users FoodItems Meals 12WeekPlan
The 12WeekPlan table would have a record for every meal of every day in the plan. The Meals table would have a record for every meal. The FoodItems table would have a record for every individual food item.
You need a table to join Meals to 12WeekPlan, as the 12WeekPlan has many meals in it (and they may repeat). (many to many relationship)
You also need a table to join Meals to FoodItems, as a meal consists of one or more food items. FoodItems can exist in more than one meal. (many to many relationship)
You can check this free data model for a Dieter Decision Support System. I guess you will need to expand it (add also exercise part), to fit your needs.